Skip to content

Commit

Permalink
Fix the precedence of exports, so TypeScript loads the right types
Browse files Browse the repository at this point in the history
In some contexts, it would try to use the JS file and type it instead of
the proper TS definitions
  • Loading branch information
sandhose committed Dec 9, 2024
1 parent 3b34f2b commit a9cd274
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
],
"exports": {
".": {
"node": {
"require": "./node.js",
"import": "./node.mjs"
"require": {
"types": "./index.d.ts",
"node": "./node.js",
"default": "./index.js"
},
"require": "./index.js",
"import": "./index.mjs",
"types": "./index.d.ts"
"import": {
"types": "./index.d.ts",
"node": "./node.mjs",
"default": "./index.mjs"
}
}
},
"files": [
Expand Down

0 comments on commit a9cd274

Please sign in to comment.