Vite 5 introduces the Environment API for multi-runtime builds, paves the way for the Rolldown bundler migration, and adds Lightning CSS support. These exercises cover the new concepts and terminology you need to understand the Vite ecosystem.
0 / 5 completed
1 / 5
What is the Environment API introduced in Vite 5?
The Environment API in Vite 5 enables frameworks to declare distinct environments such as client, ssr, and edge. Each environment has its own module graph, transform pipeline, and configuration, allowing a single Vite dev server to handle multi-runtime projects (e.g., React Server Components + browser) simultaneously.
2 / 5
What does the ssr.external option control in Vite?
ssr.external tells Vite which packages should be treated as Node.js externals during SSR bundling. By externalising packages that are already present in node_modules, you avoid double-bundling them, reduce SSR bundle size, and prevent issues with packages that rely on native Node.js semantics.
3 / 5
What is Rolldown in the context of Vite's roadmap?
Rolldown is an open-source Rust bundler designed to be a drop-in replacement for Rollup with esbuild-level speed. Vite intends to migrate its internal bundling from the current esbuild + Rollup dual approach to Rolldown, unifying the development and production pipelines and dramatically improving build performance.
4 / 5
What is Lightning CSS and how does it relate to Vite?
Lightning CSS is a high-performance Rust CSS toolchain covering parsing, transforms (nesting, custom media queries), vendor prefixing, and minification. Vite 5 added opt-in support for Lightning CSS as an alternative to PostCSS, offering significantly faster CSS processing especially in large projects.
5 / 5
In Vite 5, what change was made to the default module resolution for CommonJS dependencies during development?
Vite 5 tightened its stance on CommonJS: the dev server no longer wraps arbitrary CJS packages automatically. Dependencies that do not ship an ESM build are handled by esbuild pre-bundling, which converts them to ESM. Projects relying on implicit CJS interop may need to update dependencies or configure optimizeDeps.include.