An unofficial community-maintained Vite plugin (v0.3.0) that integrates Rust worker-build with @cloudflare/vite-plugin, enabling development and deployment of Cloudflare Workers written in Rust using Vite's dev server, HMR, and build pipeline. Key differentiators: it automatically compiles Rust to WebAssembly via worker-build, handles file watching with debounce, and configures @cloudflare/vite-plugin for seamless dev and build workflows. Requires Rust toolchain, wasm32-unknown-unknown target, and worker-build CLI. Release cadence is rapid, with multiple minor versions per months.
npm install vite-plugin-workers-rs-unofficialNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
This config sets up the Rust worker plugin with Vite, specifying the worker environment and build output directory.
Ensure `rustBuild.outDir` (default 'build') matches wrangler.jsonc's `main` directory.
Review the plugin source and verify compatibility with your Cloudflare Workers setup.
Adjust `debounceMs` and `maxRetries` options to reduce unnecessary restarts.
Run `npm install -D vite-plugin-workers-rs-unofficial` or ensure it is in package.json devDependencies.
Change `const { cloudflareRustWorker } = require(...)` to `import { cloudflareRustWorker } from 'vite-plugin-workers-rs-unofficial'`.Install worker-build: `cargo install worker-build` and ensure it is on your PATH.