/next-wasm-example

This example shows how to build a typed and optimized WebAssembly module from Rust and dynamically import it inside of Next.js.

Primary LanguageRustMIT LicenseMIT

Next.js + WebAssembly example

This example shows how to build a typed and optimized WebAssembly module from Rust and dynamically import it inside of Next.js.

How to use

Clone repo and install dependencies:

git clone https://github.com/comingAlive/next-wasm-example.git
cd next-wasm-example

npm install
# or
yarn

To compile Rust code src/lib.rs to pkg module you'll have to install Rust. Then run:

npm run build-rust
# or
yarn build-rust

Start Next.js app:

npm run dev
# or
yarn dev