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 at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

April 3, 2026
7 min read
Vite 6: Environment API, Rolldown Experiment, and What's Next

Vite 6: A Platform, Not Just a Bundler

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:

typescript
// 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:

typescript
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.

Start free

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:

BenchmarkRollupRolldownSpeedup
Build three.js4.2s0.4s10.5x
Build Lodash1.8s0.19s9.5x
Production bundlevaries~10xconsistent

Enable it experimentally in Vite 6:

typescript
// 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:

bash
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.

typescript
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:

typescript
// Before (CJS)
const { createServer } = require("vite");

// After (ESM)
import { createServer } from "vite";

Migrating From Vite 5

bash
pnpm add -D vite@6

Breaking changes to check:

  1. Node.js minimum is now 18.0.0
  2. define values are no longer stringified by default for non-string primitives - use JSON.stringify explicitly
  3. Some plugin hook signatures changed for the Environment API - check your plugins against the migration guide
  4. optimizeDeps.force removed - use --force CLI flag

References: Vite 6 blog · Rolldown · migration guide

#vite-6#rolldown#environment-api#bundler#performance

// discussion

Comments

0/4000
Mahmudul Haque Qudrati — CEO & ML Engineer at Pristren

Mahmudul Haque Qudrati

CEO & ML Engineer

Visionary technologist, software engineer, and machine learning specialist. Founder and CEO of Pristren, directing engineering teams that ship production-grade AI/ML pipelines, mission-critical full-stack applications, and developer tooling. Creator of Zlyqor, the unified team workspace platform. Author of 540+ technical guides and benchmark research reports on large language models, agentic workflows, Model Context Protocol (MCP), and modern web stacks.

PristrenZlyqor