Overview:
Quick reference instructions for making a WASM build for a Bevy game.
Reference page: Bevy Cheat Book: Browser
Building by hand:
- Build the wasm target
cargo build --release --target wasm32-unknown-unknown
- Switch to web branch
- Run wasm-bindgen:
wasm-bindgen --no-typescript --target web \
--out-dir . \
--out-name "breakout" \
./target/wasm32-unknown-unknown/release/breakout_james.wasm
- Run wasm-opt:
wasm-opt -Oz -o breakout_bg.wasm_opt breakout_bg.wasm
mv breakout_bg.wasm_opt breakout_bg.wasm