Vite 6: Environment API, Rolldown Experiment, and What's Next
Vite 6 introduces a unified Environment API for client/SSR/worker builds and ships an experimental Rolldown bundler that is 10x faster than Rollup.
Mahmudul Haque Qudrati
CEO & ML Engineer
One AI engineering post, weekly
LLM benchmarks, prompt techniques, and token-cost breakdowns — not another AI news roundup.
Vite 6 is the release that completes Vite's evolution from a dev server into a full build platform. Two changes define this release: the Environment API for multi-target builds, and the experimental Rolldown integration that previews what Vite 7 will look like.
The Environment API
Before Vite 6, handling multiple build targets (client JS, SSR Node bundle, service worker) required separate Vite configs or complex plugins. The Environment API unifies them:
// vite.config.ts
import { defineConfig } from "vite";
export default defineConfig({
environments: {
client: {
// browser output
build: { outDir: "dist/client" },
},
ssr: {
// Node.js SSR bundle
resolve: { conditions: ["node"] },
build: { outDir: "dist/server", ssr: true },
},
worker: {
// Service worker / Cloudflare Worker
build: { outDir: "dist/worker", target: "webworker" },
},
},
});
Plugins can now inspect and transform assets for specific environments:
function myPlugin() {
return {
name: "env-aware",
resolveId(id, importer, options) {
if (options.environment.name === "worker") {
// different resolution for worker env
}
},
};
}
Team workspace
Ship faster with chat, meetings, and projects in one place — Zlyqor.
Rolldown: The Rust Bundler Experiment
Rolldown is a Rust-based Rollup replacement built by the Vite team. It is API-compatible with Rollup but dramatically faster:
| Benchmark | Rollup | Rolldown | Speedup |
|---|---|---|---|
| Build three.js | 4.2s | 0.4s | 10.5x |
| Build Lodash | 1.8s | 0.19s | 9.5x |
| Production bundle | varies | ~10x | consistent |
Enable it experimentally in Vite 6:
// vite.config.ts
export default defineConfig({
experimental: {
rolldownVersion: true,
},
});
This is opt-in and may have edge cases. Rolldown is expected to become the default in Vite 7.
vite build --app
A new --app flag for framework-agnostic HTML-first builds - no framework adapter needed for simple multi-page apps:
vite build --app
This discovers all HTML entry points automatically and builds them together with shared chunk splitting.
CSS Source Maps Improvements
Vite 6 generates accurate CSS source maps for PostCSS transforms and CSS modules. Previously, source maps for CSS would point to intermediate files - now they trace back to the original source line.
export default defineConfig({
css: {
devSourcemap: true, // accurate in v6
},
});
Deprecation: CJS Node API
Vite 6 deprecates the CommonJS Node.js API (require("vite")). The ESM API is now the only supported interface. Update your config if you use createServer or build programmatically:
// Before (CJS)
const { createServer } = require("vite");
// After (ESM)
import { createServer } from "vite";
Migrating From Vite 5
pnpm add -D vite@6
Breaking changes to check:
- Node.js minimum is now 18.0.0
definevalues are no longer stringified by default for non-string primitives - useJSON.stringifyexplicitly- Some plugin hook signatures changed for the Environment API - check your plugins against the migration guide
optimizeDeps.forceremoved - use--forceCLI flag
References: Vite 6 blog · Rolldown · migration guide
Mahmudul Haque Qudrati
CEO & ML Engineer
Visionary leader with extensive experience in machine learning and software development. Drives strategic innovation and business growth.
More from Mahmudul
Related Articles
How to Use Claude to Make Videos Like Vox and Others
Claude can help you make Vox-style videos by generating scripts, editing with code, and automating animation. Here's a practical guide with real workflows and costs.
OpenAI Ends Cursor Model Access on Nov 12, 2026: What Developers Need to Know
OpenAI will terminate Cursor's access to its models on November 12, 2026, following SpaceX's acquisition. This guide explains the timeline, why it happened, and practical steps to migrate your workflow.
Ox Alpha That Became GLM 5.3 Flash: From Mystery to Preview, Everything We Know
Ox Alpha, the anonymous AI model that topped coding benchmarks, turned out to be GLM-5.3-Flash from Zhipu. Here's the full story, from mystery to official preview, with evidence and practical details.
// discussion
Comments