npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rsvelte/vite-plugin-svelte

v0.5.0

Published

Readme

@rsvelte/vite-plugin-svelte

A Vite plugin for Svelte 5, backed by the Rust rsvelte compiler. It is a fork of the official @sveltejs/vite-plugin-svelte whose compile / preprocess / HMR calls route through the rsvelte compiler (via @rsvelte/vite-plugin-svelte-native) instead of svelte/compiler — a drop-in replacement with the same plugin surface.

⚠️ Early stage. Treat it as experimental.

The Rust compiler ships as a native binding via optionalDependencies and is resolved automatically for your platform.

Compatibility: Svelte ^5.0.0, Vite 6.3+, 7, or 8.

Which setup are you using?

| Setup | How to wire it up | | --- | --- | | Plain Vite + Svelte — you call svelte() yourself in vite.config | (A) Import the plugin directly | | SvelteKit — your vite.config only has sveltekit() | (B) Alias it with a package-manager override |

If you are on SvelteKit, do not add svelte() to your plugins list — see (B).

(A) Plain Vite + Svelte

Install the plugin:

npm install -D @rsvelte/vite-plugin-svelte
# pnpm add -D @rsvelte/vite-plugin-svelte
# yarn add -D @rsvelte/vite-plugin-svelte

Add it to your Vite config:

// vite.config.js
import { defineConfig } from 'vite';
import { svelte } from '@rsvelte/vite-plugin-svelte';

export default defineConfig({
  plugins: [
    svelte({
      /* plugin options */
    })
  ]
});

The package exposes the same API as the official plugin, including vitePreprocess and loadSvelteConfig:

import { svelte, vitePreprocess } from '@rsvelte/vite-plugin-svelte';

export default {
  plugins: [
    svelte({
      preprocess: [vitePreprocess()]
    })
  ]
};

(B) SvelteKit

In a SvelteKit app your vite.config only lists sveltekit(), and the Svelte plugin is loaded from inside @sveltejs/kit under the package name @sveltejs/vite-plugin-svelte — it never appears in your config. So the way to swap in rsvelte is to redirect that package's module resolution with a package-manager override (alias), not to touch vite.config at all.

Add the override to your package.json, then reinstall:

// pnpm
{
  "pnpm": {
    "overrides": {
      "@sveltejs/vite-plugin-svelte": "npm:@rsvelte/vite-plugin-svelte@^0.4.1"
    }
  }
}
// npm
{
  "overrides": {
    "@sveltejs/vite-plugin-svelte": "npm:@rsvelte/vite-plugin-svelte@^0.4.1"
  }
}
// yarn (v1 and Berry)
{
  "resolutions": {
    "@sveltejs/vite-plugin-svelte": "npm:@rsvelte/vite-plugin-svelte@^0.4.1"
  }
}

Because the override targets the package name, it also redirects the import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' in your svelte.config.js to the rsvelte version — no change needed there either.

Don't do this

// vite.config.js — ❌ WRONG
import { sveltekit } from '@sveltejs/kit/vite';
import { svelte } from '@rsvelte/vite-plugin-svelte';

export default {
  plugins: [sveltekit(), svelte()] // two Svelte plugins → double compilation
};

sveltekit() already loads the Svelte plugin internally. Adding svelte() alongside it registers a second one, so every component compiles twice. Use the override in (B) instead.

Documentation

Because this is a fork of @sveltejs/vite-plugin-svelte, the upstream plugin options and FAQ apply.

License

MIT