The official Svelte plugin for Vite.
npm install --save-dev @sveltejs/vite-plugin-svelte// vite.config.js
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
export default defineConfig({
  plugins: [
    svelte({
      /* plugin options */
    })
  ]
});| Package | Changelog | 
|---|---|
| @sveltejs/vite-plugin-svelte | Changelog | 
| @sveltejs/vite-plugin-svelte-inspector | Changelog | 
Join the Svelte Discord server!
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 ito install dependencies
- 
pnpm playwright install chromiumto install required playwright browser binaries via local playwright-coreNOTE This repo uses playwright-corewith a bin alias toplaywrightvia package.json script Callingpnpm dlx playwright install chromiumwill not work.
- 
pnpm checkandpnpm:testto validate changes
- 
pnpm formatto format source code
- 
pnpm test:unit,pnpm test:serveorpnpm test:buildto run a subset of tests
- 
pnpm test <e2e-directory-name>to focus a specific testsuite
- 
pnpm changesetto generate a changeset
- 
pnpm generate:typesto generate public types from jsdoc (this is required when changing types and validated in ci)
- Svelte and Vite creators, maintainers and contributors
- rixo - without svelte-hmr and your support this would not have been possible
- intrnl - initial inspiration from https://github.com/intrnl/vite-plugin-svelte