Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.
/ vite-plugin-svelte Public archive

Svelte integration for Vite, a fast web dev tool.

License

Notifications You must be signed in to change notification settings

intrnl/vite-plugin-svelte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vite-plugin-svelte

Deprecated
Use the official sveltejs/vite-plugin-svelte for Vite 2.0+ instead.

Svelte integration for Vite, a fast web dev build tool.

Setup

  • Add this plugin as a dev dependency
    • npm: npm install --save-dev vite-plugin-svelte
    • pnpm: pnpm install --save-dev vite-plugin-svelte
    • yarn: yarn add --dev vite-plugin-svelte
  • Add svelte as a regular dependency
    • npm: npm install svelte
    • pnpm: pnpm install svelte
    • yarn: yarn add svelte
  • Add it into your 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: {},
        }),
      ],
    };

Recommendations

  • Dedupe svelte dependency
    This can be done with the rollupDedupe option.
    export default {
      plugins: [
        // ...
      ],
      rollupDedupe: ['svelte'],
    };

About

Svelte integration for Vite, a fast web dev tool.

Resources

License

Stars

Watchers

Forks