This project is based on this Rust WASM worker template.
- Mandelbrot set code -
crate-wasm/src/lib.rs
- Web Worker -
www/worker/worker.js
- Leaflet tile generation -
www/app/main.ts
This template comes pre-configured with all the boilerplate for compiling Rust to WebAssembly and hooking into a Webpack build pipeline.
- In the project root directory, run
cargo build
. - Within the
www/
directory:npm i
npm run build
-- Bundle the project (in production mode).npm run start
-- Serve the project locally for development athttp://localhost:8080
.
- If you need to change dependencies and get weird errors, try running
./clean.sh
to purge all caches.