Here lies an example of how to create a wasm (web assembly) module by compiling Rust code. It is based on the following set of tutorials from Mozilla, who is a major sponsor of wasm.
- Clone this repo
cd site/
npm install
npm run serve
- Use a modern browser to view http://localhost:8080/ (https://www.mozilla.org/en-US/firefox/new/)
- Install node
cd site
npm install
npm run serve
- Install rust https://www.rust-lang.org/tools/install
cargo install wasm-pack
npm adduser
to publish the rust module to npm (remember to update the package name in package json if you are publishing to your account)wasm-pack build --scope mynpmusername