Skip to content

Commit 86afa2a

Browse files
chore: update npm build script to remove source maps and dev deps
1 parent d619369 commit 86afa2a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/build_npm.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ await build({
2525
packageManager: "pnpm",
2626
compilerOptions: {
2727
lib: ["DOM", "ESNext"],
28+
sourceMap: false,
2829
},
2930
typeCheck: "both",
3031
package: {
@@ -51,8 +52,11 @@ await build({
5152
},
5253
sideEffects: false,
5354
},
54-
postBuild() {
55-
Deno.copyFileSync("LICENSE", "npm/LICENSE");
56-
Deno.copyFileSync("README.md", "npm/README.md");
55+
async postBuild() {
56+
await Deno.copyFile("LICENSE", "npm/LICENSE");
57+
await Deno.copyFile("README.md", "npm/README.md");
58+
using npmIgnoreFile = await Deno.open("npm/.npmignore", { append: true });
59+
const data = new TextEncoder().encode("deps/" + "\n" + "*.map" + "\n");
60+
npmIgnoreFile.write(data);
5761
},
5862
});

0 commit comments

Comments
 (0)