Overview:

Quick reference instructions for making a WASM build for a Bevy game.

Reference page: Bevy Cheat Book: Browser

Building by hand:

  1. Build the wasm target
cargo build --release --target wasm32-unknown-unknown
  1. Switch to web branch
  2. Run wasm-bindgen:
wasm-bindgen --no-typescript --target web \
    --out-dir . \
--out-name "breakout" \
./target/wasm32-unknown-unknown/release/breakout_james.wasm
  1. Run wasm-opt:
wasm-opt -Oz -o breakout_bg.wasm_opt breakout_bg.wasm
mv breakout_bg.wasm_opt breakout_bg.wasm