Project Templates
The Rust and WebAssembly working group curates and maintains a variety ofproject templates to help you kickstart new projects and hit the ground running.
wasm-pack-template
This template is for starting a Rust and WebAssemblyproject to be used with wasm-pack
.
Use cargo generate
to clone this project template:
cargo install cargo-generate
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git
create-wasm-app
This template is for JavaScript projects that consumepackages from npm that were created from Rust with wasm-pack
.
Use it with npm init
:
mkdir my-project
cd my-project/
npm init wasm-app
This template is often used alongside wasm-pack-template
, wherewasm-pack-template
projects are installed locally with npm link
, and pulledin as a dependency for a create-wasm-app
project.
rust-webpack-template
This template comes pre-configured with all theboilerplate for compiling Rust to WebAssembly and hooking that directly into aWebpack build pipeline with Webpack's rust-loader
.
Use it with npm init
:
mkdir my-project
cd my-project/
npm init rust-webpack