🏃♂️ Get started with Rust and WebAssembly in seconds
git clone git@github.com:kvendrik/rust-wasm-starter.git
cd rust-wasm-starter
yarn setup
yarn server
- Edit the Rust files in
./src
- Edit the HTML and JS in
./static/index.html
.
Or in one line, make sure to change your-project-name
before running:
(RWPJ_NAME="your-project-name" && git clone git@github.com:kvendrik/rust-wasm-starter.git $RWPJ_NAME && cd $RWPJ_NAME && yarn setup && yarn server)
- Will listen on port
8080
and automatically open the page when you start the server - Automatically recompiles when source files change
- Automatically reloads the page for you
PORT=3000 yarn server
allows you to start on a different portserver.mjs
manages the dev experience and is fully customizable. At the top of the file you'll find various settings that you can toggle on/off.- The
build
command can be found inpackage.json
and is used to compile the source files. If you update the name of the output directory make sure to also update this name inserver.mjs
.