flyingnobita / hello-wasm

Compiling from Rust to WebAssembly Tutorial - Mozilla

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compiling from Rust to WebAssembly Tutorial - Mozilla

https://developer.mozilla.org/en-US/docs/WebAssembly/Rust_to_wasm

WASM Package

Build WASM package in .pkg

wasm-pack build --target web

Run the package

python3 -m http.server

Convert Package for NPM

Build

wasm-pack build --target bundler

Link WASM package

Step 1

cd pkg
npm link

Step 2

cd site
npm link hello-wasm

Start webpack web server

cd site
npm install
npm run serve

About

Compiling from Rust to WebAssembly Tutorial - Mozilla


Languages

Language:HTML 46.4%Language:JavaScript 28.7%Language:Rust 24.9%