Skip to content
 
 

Repository files navigation

@mrwaip/vite-plugin-svelte

npm canary npm vite7 CI Chat

A fork of the official Svelte plugin for Vite that routes all Svelte compilation through the experimental Rust compiler @mrwaip/svelte-rs. The plugin API stays compatible with @sveltejs/vite-plugin-svelte.

Installation

There is no stable release yet — every build is published under a dist-tag, so always install by tag. Installing without one resolves to latest, which is not maintained and points at an old build.

# Vite 8 (branch `rust`)
npm install --save-dev @mrwaip/vite-plugin-svelte@canary

# Vite 6 / 7 (branch `rust-vite-7`)
npm install --save-dev @mrwaip/vite-plugin-svelte@vite7
Branch npm tag Vite Svelte
rust canary ^8.0.0-beta.7 || ^8.0.0 ^5.46.4
rust-vite-7 vite7 ^6.3.0 || ^7.0.0 ^5.46.4

The Rust compiler is an exactly pinned peer dependency — this branch requires @mrwaip/[email protected]. pnpm and npm 7+ install it for you; add it explicitly if your package manager does not auto-install peers:

npm install --save-dev @mrwaip/[email protected]

When upgrading the plugin, read the pinned version out of its peerDependencies rather than assuming — the pin moves with each compiler release:

npm view @mrwaip/vite-plugin-svelte@canary peerDependencies

Usage

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

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

Documentation

Packages

Package Changelog
@mrwaip/vite-plugin-svelte Changelog

Got a question? / Need help?

Join the Svelte Discord server!

Development

All scripts work from monorepo-root. The plugins are unbundled esm, a build step is not required while developing locally, but restarting local dev-servers can be needed to apply changes.

  • pnpm i to install dependencies

  • pnpm playwright install chromium to install required playwright browser binaries via local playwright-core

    NOTE This repo uses playwright-core with a bin alias to playwright via package.json script Calling pnpm dlx playwright install chromium will not work.

  • pnpm check and pnpm:test to validate changes

  • pnpm format to format source code

  • pnpm test:unit, pnpm test:serve or pnpm test:build to run a subset of tests

  • pnpm test <e2e-directory-name> to focus a specific testsuite

  • pnpm changeset to generate a changeset

  • pnpm generate:types to generate public types from jsdoc (this is required when changing types and validated in ci)

Credits

License

MIT

About

Svelte plugin for https://vite.dev

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages