0
Vite · Production Builds
New technique
vite build
Practice is over. Time to forge the blade you'll actually hand over.
In development, the browser fetches hundreds of separate modules: fine on localhost, far too slow over a real network. So for production, Vite does bundle: vite build (usually npm run build) runs your app through Rolldown and writes the result to dist/.
Rolldown is a fast bundler written in Rust. Before Vite 8, builds used Rollup; Rolldown keeps Rollup's plugin API, so most plugins still work. On the way, it optimises everything:
- Tree-shaking: code you never use is dropped
- Minification: code is squeezed as small as possible, with short names and no spaces
- Code splitting: the app is cut into chunks that load only when needed
- Content hashes in file names: for long-term caching