Skip to content

Commit

Permalink
Change ESM file format
Browse files Browse the repository at this point in the history
  • Loading branch information
yamiteru committed Apr 3, 2023
1 parent 6f3a054 commit d40a67f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.esm.js",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs.js"
}
},
"files": [
"dist/**/*.js",
"dist/**/*.mjs",
"dist/**/*.map",
"dist/**/*.ts"
],
Expand Down
28 changes: 13 additions & 15 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ const shared = {
target: ["esnext", "node18.0.0"],
} as BuildOptions;

(async () => {
await Promise.all([
build({
...shared,
format: "esm",
outExtension: { ".js": ".esm.js" },
splitting: true,
}),
build({
...shared,
format: "cjs",
outExtension: { ".js": ".cjs.js" },
}),
]);
})();
Promise.all([
build({
...shared,
format: "esm",
outExtension: { ".js": ".mjs" },
splitting: true,
}),
build({
...shared,
format: "cjs",
outExtension: { ".js": ".cjs.js" },
}),
]);

0 comments on commit d40a67f

Please sign in to comment.