Vite
lastmod 2026-03-05created 2021-04-3023 edits
Next generation frontend tooling. It's fast!
Vite (French for "fast", pronounced /vit/) is a new kind of frontend build tool that significantly improves the frontend development experience.
Categories
- Vite:Config (vite.config.js)
- Vite:CLI
- Vite:DependencyPreBundling
- Vite:StaticAssetHandling
- Vite:Building (for Production) - Includes how to create a library project.
- Vite:DeployingStaticSite
- Vite:EnvVariables
- Vite:Modes
- Vite:ServerSideRendering (SSR)
- Vite:BackendIntegration
- Vite:CreateLibraryProject - How to create an FE library project
Vite:Plugins
TypeScript type export:
SVG plugins:
ETC
- Rolldown-Vite - Ultra-fast Rust-based bundler
Features
Pros
- Uses ESM and the Go-based esbuild, which is 10-100x faster than Webpack/Parcel
- HMR (Hot Module Reloading) quickly applies & re-renders only the changed modules, making prototyping really fast
Setting Vue's publicPath
See Vite:Config. In short, use the base option. Use vite.config.js, not vue.config.js.
Vite CJS Node API deprecated
The CJS build of the Node API is no longer supported and is scheduled for removal in Vite 6. See the GitHub discussion for details. You should update your files or frameworks to import the ESM build.
In a standard Vite project, check the following:
- The vite.config.js file uses ESM syntax.
- Check that the nearest package.json file:
- has
"type": "module", or - uses the
.mjsor.mtsextension (e.g.vite.config.mjsorvite.config.mts).
- has
Troubleshooting
Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension
In short, see #Vite CJS Node API deprecated.
Some chunks are larger than 500 kB after minification
(!) Some chunks are larger than 500 kB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
See also
Favorite site
- Github - vite
- Webpack → Vite: A bundler migration story
- Applying vite to a company vue project :: Eddie Sunny's Blog
- Is Turbopack really 10x faster than Vite? | GeekNews (Vite, Turbopack)
Pages that link here
- @11ty/eleventy-plugin-vite
- Eleventy
- Frontend Developer
- JavaScript Module System
- JavaScript:Libraries
- PostCSS
- React
- Rolldown-Vite
- Rollup-plugin-visualizer
- Turbopack
- TypeScript
- Vite-plugin-svgr
- Vite:Building
- Vite:CreateLibraryProject
- Vite:DeployingStaticSite
- Vite:StaticAssetHandling
- Vitest
- Vue3
- Webpack