Vite
Vite is a Build Toolchain or a Development Orchestrator. While things like Deno and Bun are runtimes, Vite is a wrapper that coordinates several specialized tools to give you a cohesive experience.
Vite is a dev dependency that you install with a package manager of your choice. it's a Node.js script that tells another program to transform your code.
Vite uses:
- transpiler: esbuild (or swc)
- dev server: native esm
- dependency pre-bundler: esbuild
- production bundler: Rolldown / Rollup. (When you run
npm run build, Vite switches tools entirely.)
Vite also attaches several "quality of life" tools that you would normally have to set up manually:
- HMR (Hot Module Replacement): A built-in engine that swaps edited code in the browser without a full page refresh.
- Asset Handling: It automatically handles CSS, images, and JSON. If you import a
.png, Vite gives you the URL; if you import a.cssfile, Vite injects it into the page. - PostCSS: It has built-in support for processing modern CSS.
- Environment Variables: It handles
.envfiles automatically viaimport.meta.env.
Vite plugins
are code that hook directly into