rsvelte is a Rust port of the official Svelte 5 compiler and related developer tools. It aims to match the official compiler output and work directly with the OXC toolchain.
Website | Playground | Compatibility | Benchmarks
Warning
rsvelte passes all in-scope fixtures in the official Svelte 5 test suite, but it is still pre-1.0. APIs and behavior may change. Test it carefully before using it in production.
Most native JavaScript tools only understand JavaScript and TypeScript files.
They must call the JavaScript-based Svelte compiler to work with .svelte
files. rsvelte implements the compiler and related tools in Rust.
This lets tools such as oxlint, oxfmt, Rolldown, and tsgo add Svelte support without starting the JavaScript compiler.
Use the Vite plugin in a standard Vite and Svelte project:
npm install -D @rsvelte/vite-plugin-svelte// vite.config.js
import { svelte } from "@rsvelte/vite-plugin-svelte";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [svelte()],
});SvelteKit requires a package manager override. Do not add a second Vite plugin.
See the
@rsvelte/vite-plugin-svelte setup guide
for the exact configuration.
Each package has its own installation guide, API details, and current limitations.
| Use case | Package |
|---|---|
| Vite and SvelteKit | @rsvelte/vite-plugin-svelte |
| Svelte compiler for JavaScript and browsers (Wasm) | @rsvelte/compiler |
| Svelte compiler for Node.js (native N-API) | @rsvelte/vite-plugin-svelte-native |
| Type-checking CLI | @rsvelte/svelte-check |
| Svelte-to-TSX conversion | @rsvelte/svelte2tsx |
| Formatting | @rsvelte/fmt |
| Standalone linting | @rsvelte/lint |
| Svelte diagnostics in oxlint | @rsvelte/oxlint-plugin |
| Language server | @rsvelte/language-server |
| VS Code | rsvelte-vscode |
| Neovim, Sublime Text, Helix, and Emacs | Editor setup |
| Zed | rsvelte Zed extension |
| Rust API | rsvelte |
| C API and other languages | rsvelte_capi |
Targeting Svelte v5.56.9 (20b341f10048). This line is updated by pnpm run update-docs.
rsvelte passes 100% of the official Svelte fixtures currently in scope. CI also compares compiler output, diagnostics, formatting, linting, TypeScript output, source maps, and generated edge cases with the official tools.
- Live compatibility results
- Compatibility checks
- Real-world test method
- Live benchmarks and test details
The Svelte 4-to-5 migration tool is not in scope.
git submodule update --init --recursive
pnpm install
pnpm run generate-fixtures
cargo test --releaseSee CONTRIBUTING.md for requirements, test commands, debugging steps, performance tests, and pull request rules.