Deprecated
Use the official sveltejs/vite-plugin-svelte for Vite 2.0+ instead.
Svelte integration for Vite, a fast web dev build tool.
npm install --save-dev vite-plugin-svelte
pnpm install --save-dev vite-plugin-svelte
yarn add --dev vite-plugin-svelte
svelte
as a regular dependencynpm install svelte
pnpm install svelte
yarn add svelte
vite.config.js
file import { svelte } from 'vite-plugin-svelte';
export default {
plugins: [
// These options are optional, you don't have to configure them manually,
// for the most part.
svelte({
// Svelte compiler options
compilerOptions: {},
// Svelte HMR options, pass false to disable
hmrOptions: {},
// Svelte preprocessors
preprocess: [],
// Plugin options
pluginsOptions: {},
}),
],
};
svelte
dependencyrollupDedupe
option.export default {
plugins: [
// ...
],
rollupDedupe: ['svelte'],
};