Skip to content

Commit

Permalink
fix(build): remove separate browser bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy1339 committed Feb 23, 2024
1 parent 8c08ca9 commit 6e5b2cb
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,14 @@ async function main() {

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

await Promise.all([
// Build the a CJS Node.js bundle
esbuild.build({
entryPoints,
outdir: "pkg/dist-node",
bundle: true,
platform: "node",
target: "node18",
format: "esm",
...sharedOptions,
}),
// Build an ESM browser bundle
esbuild.build({
entryPoints,
outdir: "pkg/dist-web",
bundle: true,
platform: "browser",
format: "esm",
...sharedOptions,
}),
]);
await esbuild.build({
entryPoints,
outdir: "pkg/dist-bundle",
bundle: true,
platform: "neutral",
format: "esm",
...sharedOptions,
});

// Copy the README, LICENSE to the pkg folder
await copyFile("LICENSE", "pkg/LICENSE");
Expand All @@ -77,7 +64,7 @@ async function main() {
exports: {
".": {
types: "./dist-types/index.d.ts",
import: "./dist-src/index.js",
import: "./dist-bundle/index.js",
},
},
sideEffects: false,
Expand Down

0 comments on commit 6e5b2cb

Please sign in to comment.