build.ts (492B)
1 import { $ } from "bun"; 2 3 if (!process.env.SKIP_RUST_BUILD) { 4 await $`wasm-pack build --target web --out-dir web/pkg`; 5 } 6 7 const res = await Bun.build({ 8 entrypoints: ['./src/main.ts'], 9 outdir: './dist' 10 }); 11 12 console.log("Build complete!"); 13 console.log(res); 14 15 16 // This step should not be necessary, but unfortunately bun's bundler seems to be changing the references to the WASM without also copying it... 17 await $`cp pkg/automaton_bg.wasm dist/`; 18 19 process.exit(res.success ? 0 : 1);