Skip to content

Commit

Permalink
refactor: exports for types and package.json
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Conaclos committed Jun 19, 2023
1 parent 5874183 commit 7803092
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@
"node": "^14.18.0 || >=16.0.0"
},
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"es2015": "./dist/index.js",
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs",
"exports": {
"module": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
"./package.json": "./package.json",
".": {
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
},
"types": "./dist/index.d.ts",
"module": "./dist/index.js",
"default": "./dist/index.js"
}
},
"imports": {
"#dev": {
Expand All @@ -42,10 +47,8 @@
},
"sideEffects": false,
"files": [
"dist/*.cjs",
"dist/*.d.ts",
"dist/*.js",
"dist/**/*.cjs",
"dist/**/*.d.cts",
"dist/**/*.d.ts",
"dist/**/*.js"
],
Expand Down

0 comments on commit 7803092

Please sign in to comment.