Skip to content

Commit

Permalink
Generate .d.cts and .d.mts files (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebeby authored Aug 23, 2023
1 parent e71e259 commit 24b347d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/rotten-ads-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'pleasantest': patch
---

Fix types in export map
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,14 @@
},
"main": "./dist/cjs/index.cjs",
"exports": {
"require": "./dist/cjs/index.cjs",
"import": "./dist/esm/index.mjs",
"types": "./dist/index.d.ts"
"require": {
".": "./dist/cjs/index.cjs",
"types": "./dist/index.d.cts"
},
"import": {
".": "./dist/esm/index.mjs",
"types": "./dist/index.d.mts"
}
},
"types": "./dist/index.d.ts",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ const mainConfig = {
/** @type {import('rollup').RollupOptions} */
const typesConfig = {
input: 'src/index.ts',
output: [{ file: 'dist/index.d.ts', format: 'es' }],
output: [
{ file: 'dist/index.d.ts', format: 'es' },
{ file: 'dist/index.d.cts', format: 'es' },
{ file: 'dist/index.d.mts', format: 'es' },
],
external: [...external, 'polka', 'axe-core'],
plugins: [dts({ respectExternal: true })],
};
Expand Down

0 comments on commit 24b347d

Please sign in to comment.