Hello from Japan! Simple Enhancement for Bun Users😊
Thank you very much.
Proposal: Make bun run build smarter
Discovery
bun run build (and npm run build) requires profile.web in Cargo.toml
profile.release settings are ignored
- This is correct — but unexpected for Bun users
Simple Fix
In the build script (Webpack or wasm-pack), copy:
[package.metadata.wasm-pack.profile.release]
# See https://github.com/rustwasm/wasm-pack/issues/886#issuecomment-667669802
wasm-opt = ["-Oz", "--enable-mutable-globals"]
[package.metadata.wasm-pack.profile.web]
wasm-opt = ["-Oz", "--enable-mutable-globals"]