Skip to content

Commit 24b347d

Browse files
authored
Generate .d.cts and .d.mts files (#725)
1 parent e71e259 commit 24b347d

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

.changeset/rotten-ads-do.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'pleasantest': patch
3+
---
4+
5+
Fix types in export map

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,14 @@
118118
},
119119
"main": "./dist/cjs/index.cjs",
120120
"exports": {
121-
"require": "./dist/cjs/index.cjs",
122-
"import": "./dist/esm/index.mjs",
123-
"types": "./dist/index.d.ts"
121+
"require": {
122+
".": "./dist/cjs/index.cjs",
123+
"types": "./dist/index.d.cts"
124+
},
125+
"import": {
126+
".": "./dist/esm/index.mjs",
127+
"types": "./dist/index.d.mts"
128+
}
124129
},
125130
"types": "./dist/index.d.ts",
126131
"scripts": {

rollup.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ const mainConfig = {
5757
/** @type {import('rollup').RollupOptions} */
5858
const typesConfig = {
5959
input: 'src/index.ts',
60-
output: [{ file: 'dist/index.d.ts', format: 'es' }],
60+
output: [
61+
{ file: 'dist/index.d.ts', format: 'es' },
62+
{ file: 'dist/index.d.cts', format: 'es' },
63+
{ file: 'dist/index.d.mts', format: 'es' },
64+
],
6165
external: [...external, 'polka', 'axe-core'],
6266
plugins: [dts({ respectExternal: true })],
6367
};

0 commit comments

Comments
 (0)