Skip to content

bwasty/rust-wasm-webpack-template

Repository files navigation

rust-wasm-webpack-template

Small template for compiling Rust to WebAssembly with webpack and live reloading.

Based on rust-wasm-webpack-tutorial. Differences:

  • uses webpack-dev-server to automatically recompile and reload the browser window on file changes during development
  • optimized production build (see below)

Live Demo

Usage

  • set up Rust and Emscripten for compiling to WebAssembly, for example using the beginning of this guide.
  • npm install
  • npm run start (builds, starts dev server and opens http://localhost:8080)
  • change the Rust or JavaScript code and watch the browser reload after a few seconds

Production build

Use npm run build to generate an optimized build in the dist folder (compiling the Rust code in release mode and using UglifyJS for minifying the JavaScript code). To deploy to GitHub pages use npm run deploy.

About

Small template for compiling Rust to WebAssembly with webpack and live reloading

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published