A CLI that scaffolds and drives Rust/WebAssembly + SvelteKit projects. Write
logic in Rust, compile to WASM, and consume it from Svelte 5 — one tool
manages the entire build loop, including a generated TypeScript facade that
hides the raw wasm-bindgen package.
Setting up Rust/WASM with SvelteKit by hand means wiring together wasm-pack,
Vite plugins, path aliases, and a file watcher — then hoping they stay in sync.
wasm-pack has no --watch flag
(wasm-pack#457), so you
either poll manually or write your own watcher. Revenant does this once,
correctly, so you can focus on code.
- Rust (with
cargo) — rustup.rs - Node.js 18+ (with
npm) — nodejs.org - wasm-pack — auto-installed via
cargo install wasm-packif missing
Not sure what you have? Run revenant setup for a guided checklist.
cargo install --path .
revenant new my-app
cd my-app
revenant devOpen the URL printed by the dev server. You should see "Hello from my-app, World!" rendered by the Svelte page calling your Rust WASM function.
Scaffolds a complete project: Rust WASM crate, SvelteKit app, Vite config with
WASM plugins, and a working hello-world example. Runs npm install
automatically.
Runs an initial WASM build, starts a file watcher on rust/src/, and launches
the SvelteKit dev server. Rust changes trigger automatic WASM rebuilds plus
regeneration of web/src/lib/wasm.ts and pkg/revenant.contract.json.
Ctrl+C cleanly stops all processes.
Production build: wasm-pack build --release followed by npm run build.
Before the web build, Revenant regenerates the typed Svelte facade from the
Rust exports. Fails fast if either step errors.
Interactive checklist that verifies each required tool is installed and provides OS-specific installation instructions for anything missing.
All commands accept --verbose to show full child process output (wasm-pack,
npm). Without it, output is kept clean and errors include relevant details.
my-app/
├── revenant.toml # project config (name, wasm target, package manager)
├── GETTING_STARTED.md # tutorial: adding functions, calling from Svelte
├── rust/ # wasm-pack crate
│ ├── Cargo.toml
│ └── src/lib.rs # your Rust code — #[wasm_bindgen] exports
└── web/ # SvelteKit app
├── package.json
├── svelte.config.js
├── vite.config.js # wasm plugin + path alias to pkg/
└── src/
├── app.html
├── lib/wasm.ts # generated typed facade; import this, not pkg/
└── routes/
└── +page.svelte # imports from $lib/wasm
WASM output goes to pkg/ at the project root, alongside
pkg/revenant.contract.json — the intermediate contract manifest Revenant
derives from rust/src/lib.rs. vite-plugin-wasm and
vite-plugin-top-level-await handle browser-side loading.
v2 — Vite plugin that triggers wasm-pack on import resolution, replacing
the custom file watcher. Also: WASI target support, pnpm/yarn/bun as package
manager options, scaffold template variants.
v3 — Post-build transform pipeline (wasm-opt, size reporting, custom codegen) as a trait-based extension point.

