Vite is a frontend build tool and development server for JavaScript and TypeScript projects. In development it serves source files as native ES modules, so the server starts quickly and edits show up without a full reload; for production it bundles the app with Rollup or its Rust-based successor, Rolldown.

How Vite Works

Older bundlers such as Webpack build the whole app before the dev server can respond. Vite skips that step in development: the browser requests each module through native import statements, and Vite transforms only the files the current page asks for. Dependencies from node_modules are pre-bundled once with esbuild, because they rarely change.

For production, Vite still bundles, minifies and splits the code into chunks, because shipping hundreds of unbundled modules is slow over the network. Plugins follow the Rollup plugin API, so many Rollup plugins work in Vite unchanged.

Key Concepts

  • Native ESM — Vite serves source files as ES modules — the browser handles module resolution during development
  • Instant HMR — Hot Module Replacement updates only the changed module in under 50ms

Frequently Asked Questions

What is Vite used for?

Vite is used to run a local development server with hot module replacement and to build optimized production bundles for single-page apps and front-end frameworks. Evan You, the creator of Vue, started Vite in 2020. SvelteKit, Nuxt and Astro all build on it, and it is the usual starting point for a React app that does not use a full framework.

Why is Vite faster than Webpack?

Webpack bundles everything before serving. Vite serves source files directly via native ESM and only transforms files on demand. This makes startup instant regardless of project size.