Skip to content

Commit 123f6c7

Browse files
committed
refactor: exports for types and package.json
To ensure that `package.json` is qccessible, it has to be exported. See nodejs/node#33460 For the same reason, we now export TypeScript types.
1 parent 53518ed commit 123f6c7

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

package.json

+12-9
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,19 @@
2424
"node": "^14.18.0 || >=16.0.0"
2525
},
2626
"type": "module",
27-
"main": "./dist/index.cjs",
2827
"module": "./dist/index.js",
29-
"es2015": "./dist/index.js",
30-
"types": "./dist/index.d.ts",
28+
"main": "./dist/index.cjs",
3129
"exports": {
32-
"module": "./dist/index.js",
33-
"require": "./dist/index.cjs",
34-
"default": "./dist/index.js"
30+
"./package.json": "./package.json",
31+
".": {
32+
"require": {
33+
"types": "./dist/index.d.cts",
34+
"default": "./dist/index.cjs"
35+
},
36+
"types": "./dist/index.d.ts",
37+
"module": "./dist/index.js",
38+
"default": "./dist/index.js"
39+
}
3540
},
3641
"imports": {
3742
"#dev": {
@@ -42,10 +47,8 @@
4247
},
4348
"sideEffects": false,
4449
"files": [
45-
"dist/*.cjs",
46-
"dist/*.d.ts",
47-
"dist/*.js",
4850
"dist/**/*.cjs",
51+
"dist/**/*.d.cts",
4952
"dist/**/*.d.ts",
5053
"dist/**/*.js"
5154
],

0 commit comments

Comments
 (0)