Skip to content

Commit

Permalink
fix: correct output from build script to be ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Feb 25, 2024
1 parent 12b8a00 commit 6cac6a6
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ async function main() {

const entryPoints = ["./pkg/dist-src/index.js"];

// Build a CJS Node.js bundle
// Build a bundle
await esbuild.build({
entryPoints,
outdir: "pkg/dist-node",
outdir: "pkg/dist-bundle",
bundle: true,
platform: "node",
target: "node14",
format: "cjs",
platform: "neutral",
format: "esm",
...sharedOptions,
});

Expand All @@ -63,9 +62,12 @@ async function main() {
{
...pkg,
files: ["dist-*/**", "bin/**"],
main: "dist-node/index.js",
types: "dist-types/index.d.ts",
module: "dist-src/index.js",
exports: {
".": {
types: "./dist-types/index.d.ts",
import: "./dist-bundle/index.js",
},
},
sideEffects: false,
},
null,
Expand Down

0 comments on commit 6cac6a6

Please sign in to comment.