Rust wasm demo project built with Yew, Trunk and TailwindCSS.
Add build support for WebAssembly platform.
rustup target add wasm32-unknown-unknown
Trunk is a WASM web application bundler for Rust.
cargo install --locked trunk # install trunk
trunk --help # check if successfully installed
pnpm is highly recommended as a replacement of npm.
pnpm install # install dependencies specified in package.json
TailwindCSS is a utility-first CSS framework and the CLI is used for css generation.
# check if tailwindcss has been successfully installed
pnpm exec tailwindcss --help
Binaryen contains optimizer and toolchain for WebAssembly.
# check if binaryen has been successfully installed
pnpm exec wasm-opt --help
trunk serve # build debug version and serve locally with hot reload
trunk build --release # build release version
- apply trunk post hook only when build release version.