Skip to content

Commit 479d0b4

Browse files
authoredFeb 23, 2024··
fix(build): remove NodeJS/Browser specific builds (#404)
The 2 builds are the same in this case. It fixes usage with the `moduleResolution` option set to `bundler`
1 parent db5708e commit 479d0b4

File tree

1 file changed

+3
-33
lines changed

1 file changed

+3
-33
lines changed
 

‎scripts/build.mjs

+3-33
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,6 @@ async function main() {
3333
await rm(typeFile);
3434
}
3535

36-
const entryPoints = ["./pkg/dist-src/index.js"];
37-
38-
await Promise.all([
39-
// Build the a CJS Node.js bundle
40-
esbuild.build({
41-
entryPoints,
42-
outdir: "pkg/dist-node",
43-
bundle: true,
44-
platform: "node",
45-
target: "node18",
46-
format: "esm",
47-
...sharedOptions,
48-
}),
49-
// Build an ESM browser bundle
50-
esbuild.build({
51-
entryPoints,
52-
outdir: "pkg/dist-web",
53-
bundle: true,
54-
platform: "browser",
55-
format: "esm",
56-
...sharedOptions,
57-
}),
58-
]);
59-
6036
// Copy the README, LICENSE to the pkg folder
6137
await copyFile("LICENSE", "pkg/LICENSE");
6238
await copyFile("README.md", "pkg/README.md");
@@ -76,18 +52,12 @@ async function main() {
7652
files: ["dist-*/**", "bin/**"],
7753
exports: {
7854
".": {
79-
node: {
80-
types: "./dist-types/index.d.ts",
81-
import: "./dist-node/index.js",
82-
},
83-
browser: {
84-
types: "./dist-types/index.d.ts",
85-
import: "./dist-web/index.js",
86-
}
55+
types: "./dist-types/index.d.ts",
56+
import: "./dist-src/index.js",
8757
}
8858
},
8959
sideEffects: false,
90-
unpkg: "dist-web/index.js",
60+
unpkg: "dist-src/index.js",
9161
},
9262
null,
9363
2

0 commit comments

Comments
 (0)
Please sign in to comment.