In order to setup a project we need to install the nightly build of Rust and add the WebAssembly target. For an improved workflow we also install the CLI tools wasm-pack and wasm-gc.
brew install rustup
Setup nightly toolchain as default.
rustup default nightly
Then we add the target
rustup target add wasm32-unknown-unknown
In addition, we use
cargo, Rust's package manager, to install
cargo install wasm-pack
For the first couple lessons, we don't use
wasm-pack. Instead, we're going to use a tool called
wasm-gc. We install it.
cargo instal wasm-gc
wasm-gc is a tool to remove all unneeded exports, imports, functions, and so on from a WebAssembly module.
Install HTTPS server:
cargo install https