Skip to content

Commit

Permalink
feat: export types for module resolution node 16
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Jun 15, 2022
1 parent cb651fb commit 20241c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@
"sideEffects": false,
"type": "module",
"exports": {
"types": {
"import": "./dist/node/types/current/index.d.mts",
"require": "./dist/node/types/current/index.d.cts"
},
"import": "./dist/node/index.mjs",
"require": "./dist/node/index.cjs",
"default": "./dist/node/index.cjs"
"require": "./dist/node/index.cjs"
},
"main": "dist/node/index.cjs",
"module": "dist/node/index.mjs",
Expand Down
14 changes: 10 additions & 4 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ const esm = defineConfig({
const dts = defineConfig({
...common,

output: {
file: "dist/node/types/current/index.d.ts",
format: "es",
},
output: [
{
file: pkg.exports.types.import,
format: "esm",
},
{
file: pkg.exports.types.require,
format: "cjs",
},
],

plugins: [
rollupPluginTypescript({
Expand Down

0 comments on commit 20241c5

Please sign in to comment.