Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Vite Knowledge Patch?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nevaberry-vite-knowledge-patch)
---
name: vite-knowledge-patch
description: Vite
version: "8.4.0"
license: MIT
metadata:
author: Nevaberry
---
# Vite Compatibility Guidance
Load this skill when migrating Vite configuration, maintaining plugins or
framework environments, or working with builds, dependency optimization,
SSR, stylesheets, workers, and development-server behavior.
Use the topic references for detailed conditions, examples, and source attributions.
## Reference index
| Reference | Topics |
| --- | --- |
| [Migration and runtime requirements](references/migration-requirements.md) | Removed options, deprecated APIs, warnings, bundler migration, plugin and toolchain compatibility |
| [Builds and dependency optimization](references/build-optimization.md) | Targets, build inputs, manifests, asset emission, chunk import maps, optimizer configuration and invalidation |
| [Development server, HMR, globs, and assets](references/dev-server-assets.md) | Network and filesystem settings, diagnostics, Devtools, bundled development, HMR, HTML asset attributes, workers |
| [Plugin and framework APIs](references/plugin-api.md) | Environments, lifecycle hooks, plugin context, configuration types, module runner integration |
| [Resolution and module interoperability](references/resolution-modules.md) | SSR conditions, aliases, package imports, config loading, optimized dependency interop, WebAssembly |
| [Transforms, TypeScript, and styles](references/transforms-styles.md) | TypeScript configuration, decorator metadata, JSX migration, Sass, CSS processing, minification, source maps |
## Breaking changes and deprecations
### Removed and moved configuration
| Setting or API | Migration |
| --- | --- |
| `optimizeDeps.rollupOptions` | Removed; move dependency optimizer bundler settings to `optimizeDeps.rolldownOptions`. |
| `css.devSourcemap` | Move to `dev.sourcemap.css` for CSS source maps in development. |
| `server.fs.cachedChecks` | Remove when upgrading to Vite 6. |
| `resolve.alias` entry `customResolver` | Deprecated in Vite 8; use a plugin with `enforce: 'pre'` and a `resolveId` hook. |
| `ResolvedConfig.createResolver` | Deprecated in Vite 7; use `createIdResolver` for environment-aware ID resolution. |
| `HotUpdateContext` | Update imports to Vite 6's `HotUpdateOptions` type for the environment-aware `hotUpdate` hook. |
| `keepProcessEnv` in `DefaultEnvironmentOptions` | Removed from this type. |
The `--configLoader` CLI option is stable; its `runner` value is deprecated.
Vite warns when the deprecated `envFile` option is set.
The standalone `vite optimize` command is deprecated. Use `vite --force` to
start the dev server and re-run optimization in every environment where it is enabled.
### Sass and SSR stylesheet imports
Vite 7 removes Sass's legacy API and defaults `css.preprocessorMaxWorkers` to
`true`. Remove `css.preprocessorOptions.sass.api: 'legacy'` or
`css.preprocessorOptions.scss.api: 'legacy'` to use the compiler API.
Vite 6 removes the default export of plain stylesheets in SSR development.
Use `import css from './style.css?inline'` when a server module needs CSS text.
Vite now keeps CSS imports in its processing pipeline by default in SSR.
### HMR dependency specifiers
Vite 8 removes the resolution fallback for dependencies passed to
`import.meta.hot.accept()`. Use the same specifier in the import and accept
call: `import './dep.js'` with `import.meta.hot.accept('./dep.js', callback)`.
### Future migration warnings
Set `future: 'warn'` to enable all available migration warnings:
```ts
export default {
future: 'warn',
}
```
These include `server.pluginContainer`, `server.reloadModule`,
`server.warmupRequest`, `server.hot`, and the SSR argument in plugin hooks.
The `removeSsrLoadModule` warning also covers `server.ssrFixStacktrace` and
`server.ssrRewriteStacktrace`.
## Build defaults, migration, and output consumers
### Bundler and transform migration
Vite 8 translates existing `esbuild` and `rollupOptions` settings to their
Oxc and Rolldown equivalents. To isolate bundler compatibility issues before
upgrading Vite, try `rolldown-vite` on Vite 7 first.
Starting in 8.1.1, translating `esbuild.jsxSideEffects` to `oxc.jsx.pure`
inverts the value: `esbuild.jsxSideEffects: true` maps to `oxc.jsx.pure: false`.
`@vitejs/plugin-react` v6 uses Oxc for React Refresh and drops its Babel
dependency. Opt in to React Compiler with `reactCompilerPreset` and
`@rolldown/plugin-babel`. The v5 plugin still works with Vite 8, so the two
upgrades can be done separately.
### Browser targets and manifest consumers
Vite 7 changes the default `build.target` from `'modules'` to
`'baseline-widely-available'`: Chrome 107, Edge 107, Firefox 104, and Safari 16.0.
Vite refreshes these minimums with each major release to match Baseline Widely Available.
With `build.manifest` enabled, the manifest now includes worker chunks.
The `imports` field in `manifest.json` lists only JavaScript chunks.
Standalone CSS entry records include an `assets` field for referenced assets.
With `build.cssCodeSplit: false`, use manifest key `'style.css'` and read its
`file` field for the emitted URL path.
Vite 8.4.0 skips empty CSS files; consumers should allow an empty stylesheet's output file to be absent. The build reference describes the different
7.1.0 release note; check behavior on intermediate versions.
### Experimental chunk import maps
Set `build.chunkImportMap` to keep chunk import specifiers stable when
imported chunks change. This experimental option is incompatible with
`experimental.renderBuiltUrl`. It also maps CSS chunks, and client builds
support it with `sharedPlugins: true` starting in 8.2.1.
## Configuration and dependency optimization
### TypeScript configuration and aliases
Set `resolve.tsconfigPaths` to `true` to resolve aliases from `tsconfig.json`
`paths`; it is off by default:
```ts
export default {
resolve: { tsconfigPaths: true },
}
```
Starting in 8.1.1, this also enables path aliases in CSS and Sass `@import`
statements. Vite automatically honors `emitDecoratorMetadata`, so projects
can remove plugins used solely to emit decorator metadata.
Vite 8.3.0-beta.0 adds the top-level `tsconfig` option for selecting the
project's TypeScript configuration. The dependency optimizer now honors it
during both scanning and bundling.
### Environment variables and optimizer controls
Set `envDir` to `false` to skip loading `.env` files.
Vite warns when `define['process.env']` contains a `path` key with a value.
SSR environments support dependency discovery and pre-bundling. An include
can target a nested dependency, such as
`environments.ssr.optimizeDeps.include: ['parent-dep > nested-dep']`.
When an environment sets `keepProcessEnv: true`, its optimizer preserves
`process.env.NODE_ENV`.
Set `optimizeDeps.ignoreOutdatedRequests` to `true` to ignore outdated
optimized-dependency requests during development, starting in 7.3.1.
Editing a dependency patch in place now invalidates cached pre-bundled
dependencies even when the lockfile stays the same.
## Development server and framework integrations
### Experimental environments and bundled development
The experimental Environment API lets framework authors make development
environments more closely match production runtimes. Adoption is optional
for existing custom SSR apps. Use `createRunnableDevEnvironment` to give a
custom environment a module runner, configuring its factory under the named
environment's `dev.createEnvironment`; the top-level factory applies to the client.
Enable experimental browser-side bundling with `vite --experimental-bundle`
or `experimental.bundledDev: true`. Third-party plugins may require changes.
Experimental bundled development now also supports SSR environments.
Plugins can coordinate environment builds with the experimental `buildApp` hook.
### Filesystem access and server connections
Set `server.fs.strict` to `'extended'` to register additional safe module
references, including those in HTML. Safe module paths are tracked per
environment; plugins can register them through `environment.addSafeModule`.
Starting in 8.1.0-beta.0, configure the dev-server WebSocket under `server.ws`,
for example moving `server.hmr.clientPort` to `server.ws.clientPort`.
Starting in 8.2.1, use `server.port: 0` or `vite --port 0` to let the OS choose a free port.
### Devtools and console forwarding
Use `devtools` to enable integrated Vite Devtools for debugging and analysis
through the dev server. It requires `@vitejs/devtools` 0.1 or later; upgrade
older installations. Vite 8.2.2 accepts 0.5.0 in its peer dependency range.
Set `server.forwardConsole` to `true` to see browser console logs and errors
in the terminal. Vite also enables forwarding automatically when it detects
a coding agent. Run `vite --debug` for environment-loading diagnostics.
## Assets, styles, and WebAssembly
Use `html.additionalAssetSources` to identify additional HTML asset URL
attributes: keys are element names, and `srcAttributes` lists the attributes.
A single attribute can also be supplied as a string.
Pass `caseSensitive: false` to `import.meta.glob` to match filenames
regardless of case, including during hot updates.
CSS preprocessors work with `css.transformer: 'lightningcss'`. With that
transformer, stylesheets can import external CSS files and plugins can
register file dependencies. Vite 8 installs `lightningcss` as a regular
dependency, so its CSS minification works out of the box.
SSR modules can initialize WebAssembly through `.wasm?init`. Direct `.wasm`
ESM imports expose named exports. Use `import source` with a `.wasm` file to
obtain a `WebAssembly.Module` for instantiation yourself. `vite preview`
supports serving compressed `.wasm` responses.