This example shows how to build a typed and optimized WebAssembly module from Rust and dynamically import it inside of Next.js.
Clone repo and install dependencies:
git clone https://github.com/comingAlive/next-wasm-example.git
cd next-wasm-example
npm install
# or
yarnTo compile Rust code src/lib.rs to pkg module you'll have to install
Rust. Then run:
npm run build-rust
# or
yarn build-rustStart Next.js app:
npm run dev
# or
yarn dev