@sveltejs/vite-plugin-svelte
The official Svelte plugin for Vite.
Installation
npm install --save-dev @sveltejs/vite-plugin-svelte
Usage
// vite.config.js
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
export default defineConfig({
plugins: [
svelte({
/* plugin options */
})
]
});
Documentation
Packages
Package | Changelog |
---|---|
@sveltejs/vite-plugin-svelte | Changelog |
@sveltejs/vite-plugin-svelte-inspector | Changelog |
Got a question? / Need help?
Join the Svelte Discord server!
Development
- Run
pnpm i
to install dependencies - Run
pnpm dev
inpackages/vite-plugin-svelte
to autobuild plugin - Run
pnpm dev
inpackages/playground/xxx
to start a Vite app
Note that changes in the plugin needs restart of the Vite dev server.
Credits
- 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