Call Rust functions in Svelte web app via WebAssembly. The function would be available as node module with name provided by package.name
in Cargo.toml
.
- Node.js stuff.
- Rust toolchain
wasm-pack
- clone this repo
npm i
: This'll also triggersprepare
script to build rust/wasm as local dependency first topkg
folder.npm run preview
to serve preview.- All other details can be read from
package.json
.
Note: npm run dev
or check:watch
wouldn't work, for now.