A wasm-pack plugin for Vite that enables WebAssembly integration via Rust crates. v2.0.11 requires Vite >=2.8.0 and supports HMR, friendly error messages, and automatic rebuilding. It relies on the `rsw` CLI tool (cargo install rsw) to manage Rust crate generation and linking. Differentiated by its seamless Vite plugin approach vs manual wasm-pack setup. Active development.
npm install vite-plugin-rswNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup: import plugin, add to Vite config, install rsw CLI, generate and link a Rust crate.
Run `cargo install rsw`
Set link = true under [[crates]] in rsw.toml
Upgrade Vite to >=2.8.0
Use script: 'rsw watch & vite' (or concurrently)
Use script: 'rsw build && tsc && vite build'
Install via npm/yarn: npm i -D vite-plugin-rsw
Switch to Rust nightly: rustup default nightly
Ensure Rust, wasm-pack, and required target (e.g., wasm32-unknown-unknown) are installed
Run `yarn rsw init` to generate rsw.toml