Skip to content

Commit c80a9df

Browse files
committed
Fix exports entry in package.json
1 parent 4fd11a4 commit c80a9df

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
},
2626
"exports": {
2727
".": {
28-
"browser": "./dist/react-use-wizard.esm.js",
29-
"import": "./dist/react-use-wizard.esm.js",
28+
"browser": "./dist/react-use-wizard.mjs",
29+
"import": "./dist/react-use-wizard.mjs",
3030
"require": "./dist/index.js"
3131
}
3232
},

tsdx.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const path = require('node:path');
2+
3+
// Not transpiled with TypeScript or Babel, so use plain Es6/Node.js!
4+
module.exports = {
5+
// This function will run for each entry/format/env combination
6+
rollup(config, options) {
7+
if (options.format === 'esm') {
8+
const outputFile = path.join(__dirname, 'dist', `${options.name}.mjs`);
9+
10+
return {
11+
...config,
12+
output: {
13+
...config.output,
14+
file: outputFile,
15+
},
16+
};
17+
}
18+
19+
return config;
20+
},
21+
};

0 commit comments

Comments
 (0)