- rust - recommend using rustup to manage rust versions and targets
- trunk
- wasm-unknown-unknown target:
rustup target add wasm32-unknown-unknown
(Optional) update CSS:
npx tailwindcss -i ./src/assets/style.css -o ./static/tailwind.css
Package the site for deployment:
trunk build --releasewasm-opt -Os dist/<binary file name>.wasm -o dist/<binary file name>.wasm
ON M1 MACS ONLY
The version of clang installed on M1 Macs does not support wasm targets. See this thread.
TLDR
brew install llvm
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export AR=/opt/homebrew/opt/llvm/bin/llvm-ar
trunk build
Make sure Trunk.toml is configured for local hosting:
public_url = "/"
Run a development server with live-reloading:
trunk serve
Navigate to localhost:8080