https://github.com/sveltejs/vite-plugin-svelte
Svelte plugin for https://vite.dev
https://github.com/sveltejs/vite-plugin-svelte
svelte vite vite-plugin
Last synced: 16 days ago
JSON representation
Svelte plugin for https://vite.dev
- Host: GitHub
- URL: https://github.com/sveltejs/vite-plugin-svelte
- Owner: sveltejs
- License: mit
- Created: 2021-03-16T20:54:27.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-22T19:26:18.000Z (17 days ago)
- Last Synced: 2025-04-23T23:17:01.814Z (16 days ago)
- Topics: svelte, vite, vite-plugin
- Language: JavaScript
- Homepage:
- Size: 6.02 MB
- Stars: 910
- Watchers: 14
- Forks: 114
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- fucking-awesome-vite - vite-plugin-svelte - Adds Svelte support. Official plugin of Svelte team. (Plugins / Svelte)
- awesome-vite - vite-plugin-svelte - Adds Svelte support. Official plugin of Svelte team. (Plugins / Svelte)
README
# @sveltejs/vite-plugin-svelte
[](https://www.npmjs.com/package/@sveltejs/vite-plugin-svelte)
[](https://github.com/sveltejs/vite-plugin-svelte/actions/workflows/ci.yml)
[](https://svelte.dev/chat)The official [Svelte](https://svelte.dev) plugin for [Vite](https://vitejs.dev).
## Installation
```bash
npm install --save-dev @sveltejs/vite-plugin-svelte
```## Usage
```js
// vite.config.js
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';export default defineConfig({
plugins: [
svelte({
/* plugin options */
})
]
});
```## Documentation
- [Plugin options](./docs/config.md)
- [Svelte Inspector](./docs/inspector.md)
- [FAQ](./docs/faq.md)## Packages
| Package | Changelog |
| ------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| [@sveltejs/vite-plugin-svelte](packages/vite-plugin-svelte) | [Changelog](packages/vite-plugin-svelte/CHANGELOG.md) |
| [@sveltejs/vite-plugin-svelte-inspector](packages/vite-plugin-svelte-inspector) | [Changelog](packages/vite-plugin-svelte-inspector/CHANGELOG.md) |## Got a question? / Need help?
Join the [Svelte Discord server](https://svelte.dev/chat)!
## Development
- Run `pnpm i` to install dependencies
- Run `pnpm dev` in `packages/vite-plugin-svelte` to autobuild plugin
- Run `pnpm dev` in `packages/playground/xxx` to start a Vite appNote that changes in the plugin needs restart of the Vite dev server.
## Credits
- [Svelte](https://svelte.dev) and [Vite](https://github.com/vitejs/vite#readme) creators, maintainers and contributors
- [rixo](https://github.com/rixo) - without svelte-hmr and your support this would not have been possible
- [intrnl](https://github.com/intrnl) - initial inspiration from https://github.com/intrnl/vite-plugin-svelte## License
[MIT](./LICENSE)