svelte-rust-wasm Svelte Themes

Svelte Rust Wasm

An example app that puts Rust in the browser

svelte-rust-wasm

An example webapp that uses wasm-pack and svelte for using Rust in the browser.

Build

First, make sure all necessary tools are available:

# .envrc

PATH_add "$(nix-build --no-link \
    --tarball-ttl 0 \
    https://github.com/nmattia/dune/archive/master.tar.gz \
    --argstr user "$USER" --argstr path "$PWD" \
    --arg packages '[ "rustc" "cargo" "rustfmt" "nodejs" "wasm-pack" ]' \
    --arg env '[ "HOME='"$PWD"'/.home"  ]' \
    )/bin"

Then, build the wasm file:

cd lib && wasm-pack build

Then run the webapp:

cd svelte-app && npm ci && npm run dev

Top categories

Loading Svelte Themes