1---
2name: vite
3description: "Vite next-gen frontend tooling: dev server, HMR, build, config, plugins, Environment API, Rolldown. Use when setting up or running a Vite project, configuring vite.config.*, authoring plugins, working with HMR or JS API, or managing environment variables and modes. Keywords: vite.config, bundler, Vite, HMR, Rolldown."
4metadata:
5 version: "8.2.2"
6 release_date: "2026-08-20"
7---89
10# Vite
11
12## Quick navigation
13
14- Getting started: references/getting-started.md
15- Philosophy and rationale: references/philosophy.md, references/why-vite.md
16- Features: references/features.md
17- CLI: references/cli.md
18- Plugins (usage): references/using-plugins.md
19- Plugin API: references/api-plugin.md
20- HMR API: references/api-hmr.md
21- JavaScript API: references/api-javascript.md
22- Config reference: references/config.md
23- Dependency optimization: references/dep-pre-bundling.md
24- Assets: references/assets.md
25- Build: references/build.md
26- Static deploy: references/static-deploy.md
27- Env & modes: references/env-and-mode.md
28- SSR: references/ssr.md
29- Backend integration: references/backend-integration.md
30- Troubleshooting: references/troubleshooting.md
31- Performance: references/performance.md
32- Rolldown: references/rolldown.md
33- Migration: references/migration.md
34- Breaking changes: references/breaking-changes.md
35- Environment API: references/api-environment.md
36- Environment instances: references/api-environment-instances.md
37- Env plugins: references/api-environment-plugins.md
38- Env frameworks: references/api-environment-frameworks.md
39- Env runtimes: references/api-environment-runtimes.md
40
41## Core rules
42
43- Prefer minimal configuration; extend only as needed.
44- Keep `index.html` as a first-class entry point when using Vite defaults.
45- Treat dev server settings and build settings separately.
46- Document mode-dependent behavior for env variables and `define`.
47- Use `future` config to opt-in to deprecation warnings before migration.
48
49## Recipes
50
51- Scaffold a project with `npm create vite@latest`.
52- Configure aliases, server options, and build outputs in `vite.config.*`.
53- Load `.env` values into config with `loadEnv` when config needs them.
54- Add plugins with `plugins: []` and define `apply` or `enforce` when needed.
55- Use HMR APIs for fine-grained updates when plugin or framework needs it.
56- Use `optimizeDeps.include/exclude` when deps aren't discovered on startup.
57- Use `build.rollupOptions.input` for multi-page apps.
58- Use the top-level `input` option to declare the entry once for apps without `index.html`; it feeds `build.rolldownOptions.input`, `build.lib.entry`, `build.ssr`, and `optimizeDeps.entries` by default.
59- Enable deprecation warnings: `future: { removeSsrLoadModule: 'warn' }`.
60- Use `hotUpdate` hook instead of `handleHotUpdate` for environment-aware HMR.
61- Use `this.environment` instead of `options.ssr` in plugin hooks.
62
63## Release Highlights (8.0.0)
64
65- Default browser target is raised again under `baseline-widely-available`.
66- CommonJS default-import interop becomes more consistent and may expose packages that relied on older ambiguous behavior.
67- Vite stops resolving `browser` vs `module` via format sniffing and follows configured `resolve.mainFields` more strictly.
68- JS API `build()` now throws `BundleError` with nested `.errors` when multiple Rolldown-level errors are present.
69- Rolldown transition becomes more explicit: `build.rollupOptions` / `worker.rollupOptions` are deprecated in favor of `*.rolldownOptions`.
70
71## Release Highlights (8.1.0 -> 8.1.5)
72
73- **WASM ESM integration**: direct `.wasm` imports work as ES modules natively.
74- **Zero-config build caching**: integration with Vite Task enables build caching without manual setup.
75- **`server.hmr` renamed to `server.ws`**: WebSocket options move under `server.ws`; update configs that set HMR transport options.
76- **New options**: `html.additionalAssetSources` for custom asset sources during HTML transform, `import.meta.glob` `caseSensitive`, multiple hosts via `__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS`, and an extended default `server.fs.deny` list.
77- **8.1.1 -> 8.1.5**: stability only (stack-trace handling, dependency bumps, module-resolution edge cases).
78
79## Release Highlights (8.2.0)
80
81- **New top-level `input` option**: `input: string | string[] | { [entryAlias: string]: string }` resolves relative to the project root and becomes the default value for `build.rolldownOptions.input`, `build.lib.entry`, `build.ssr` (when set to `true`), and `optimizeDeps.entries` whenever those are left unset; useful for apps that skip `index.html` and would otherwise repeat the same entry path in several options. The resolved `input` paths are also added to `server.fs.allow`, matching how imported modules are already allowed.
82- **Bundled dev mode (`experimental.bundledDev`)**: a boundary-less edit now triggers exactly one reload; the client tells the server to rebuild first and only then issues `full-reload`, so the "bundling in progress" fallback page no longer flashes between an edit and the reload. Worker files (`new Worker(new URL(...))`, `?worker` imports) are now correctly re-emitted through HMR instead of going stale after an edit.
83- **Native loader / native-config compatibility**: warnings about features unsupported by `configLoader: 'native'` now include a column alongside the line number, and virtual modules are excluded from the native-config compatibility check so plugin-generated virtual files no longer trigger false positives.
84- **Type-safe PostCSS config**: Vite exports `PostcssUserConfig` (re-exported from `postcss-load-config`'s `Config` type) so `postcss.config.js`/`.ts` can be typed directly.
85- **Network URL labeling**: dev server network URLs now resolve and print the OS network-interface name (e.g. `eth0`, `wlan0`) even when `server.host` is an explicit address, not only when Vite auto-detects every interface.
86- **Rolldown and optimizer updates**: Rolldown bumps to `~1.2.0`, bringing client-side HMR handling into `experimental.bundledDev`; the dependency optimizer's lockfile-hash cache now also recognizes `aube-lock.yaml` (Aube) and `nub.lock` (nub), so those package managers correctly invalidate `node_modules/.vite` on dependency changes.
87
88## Patch Notes (8.0.14 -> 8.0.16)
89
90- Rolldown moves to `1.0.3` (was `1.0.2` in `8.0.14`); if you maintain plugin or build guidance, validate it against the current Rolldown behavior instead of assuming early `8.0.x` patch semantics.
91- Dev server now sends HTTP `408` on request timeout instead of hanging the connection (`8.0.15`).
92- `launch-editor-middleware` rejects UNC paths and Windows alternate paths, closing a local path-traversal vector (`8.0.16`); relevant if you expose the dev server beyond localhost.
93- `8.0.15` fixes: `/@fs/` HTML-proxy cache-key mismatch, relative-glob-in-virtual-module errors when no files match, closing the Rolldown bundle when `write()` rejects, and `onWarn` for `viteResolvePlugin` in JS plugin containers.
94- `transformIndexHtml` handles trailing-slash paths more reliably, which matters for plugins and static deploy setups that rewrite or inject HTML on directory-style URLs.
95- Dependency scanning now passes Oxc JSX options through the optimizer path, so JSX-heavy linked dependencies should behave closer to the main transform pipeline.
96
97## Prohibitions
98
99- Do not copy large verbatim chunks from vendor docs.
100- Do not assume framework-specific behavior without verifying.
101
102## Links
103
104- [Documentation](https://vite.dev/)
105- [Releases](https://github.com/vitejs/vite/releases)
106- [GitHub](https://github.com/vitejs/vite)
107- [npm](https://www.npmjs.com/package/vite)