Skip to content

Latest commit

 

History

3,816 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rsvelte

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.

Why rsvelte

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.

Quick start

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.

Packages

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

Compatibility and performance

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.

The Svelte 4-to-5 migration tool is not in scope.

Contributing

git submodule update --init --recursive
pnpm install
pnpm run generate-fixtures
cargo test --release

See CONTRIBUTING.md for requirements, test commands, debugging steps, performance tests, and pull request rules.

License

MIT

Releases

Packages

Contributors

Languages