Skip to content

Commit a9cd274

Browse files
committed
Fix the precedence of exports, so TypeScript loads the right types
In some contexts, it would try to use the JS file and type it instead of the proper TS definitions
1 parent 3b34f2b commit a9cd274

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@
2020
],
2121
"exports": {
2222
".": {
23-
"node": {
24-
"require": "./node.js",
25-
"import": "./node.mjs"
23+
"require": {
24+
"types": "./index.d.ts",
25+
"node": "./node.js",
26+
"default": "./index.js"
2627
},
27-
"require": "./index.js",
28-
"import": "./index.mjs",
29-
"types": "./index.d.ts"
28+
"import": {
29+
"types": "./index.d.ts",
30+
"node": "./node.mjs",
31+
"default": "./index.mjs"
32+
}
3033
}
3134
},
3235
"files": [

0 commit comments

Comments
 (0)