Skip to content

Commit

Permalink
build: bundle webassemblyjs parse utils
Browse files Browse the repository at this point in the history
reduces pkg size but also allows patching issues
  • Loading branch information
pi0 committed Jan 16, 2024
1 parent eefa78c commit fe31895
Show file tree
Hide file tree
Showing 8 changed files with 6,847 additions and 326 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
coverage
dist
examples
lib
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.tmp
lib
15 changes: 15 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,19 @@ export default defineBuildConfig({
rollup: { emitCJS: true },
entries: ["src/plugin", "src/tools"],
externals: ["unwasm", "rollup"],
hooks: {
async "build:before"() {
const { build } = await import("esbuild");
await build({
entryPoints: ["lib/wasm-parser.in.mjs"],
bundle: true,
outfile: "lib/wasm-parser.mjs",
format: "esm",
platform: "node",
banner: {
js: "// webassemblyjs (MIT) - Copyright (c) 2018 Sven Sauleau <sven@sauleau.com>\n",
},
});
},
},
});
1 change: 1 addition & 0 deletions lib/wasm-parser.in.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { decode } from "@webassemblyjs/wasm-parser";

0 comments on commit fe31895

Please sign in to comment.