<!-- PkgPulse AI-readable guide source -->
<!-- Canonical: https://www.pkgpulse.com/guides/vite-7-to-8-migration -->
<!-- Raw Markdown: https://www.pkgpulse.com/guides/vite-7-to-8-migration/raw.md -->
<!-- Source path: content/guides/vite-7-to-8-migration.mdx -->

---
title: "Migrating React and Vue Apps from Vite 7 to Vite 8"
description: "Upgrade React and Vue apps from Vite 7 to Vite 8. Check Rolldown config, plugin compatibility, SSR output and CI before switching builds, with a rollback plan."
date: "2026-12-03"
author: "PkgPulse Team"
tags: ["migration", "build tools", "plugins"]
tier: 1
tileSubjects:
  - slug: vite
    name: Vite
  - slug: react
    name: React
  - slug: vue
    name: Vue
---

<!-- content-block--tldr -->
<!-- pipeline:claim c001 -->

Upgrade Vite first. Keep your React or Vue runtime and framework plugin if their peer ranges allow it, and keep your deployment settings fixed. Start from a passing Vite 7 build on the Node version CI uses. After a clean install on Vite 8, serve the production build and check that the same entry point, styles and lazy routes load at the same public path.

Vite 8 uses Rolldown for dependency optimization and production bundling, and Oxc for JavaScript transforms. Check emitted assets, build plugins and server-side rendering (SSR) against the built release. [Vite release notes](https://vite.dev/blog/announcing-vite8)

## Capture the Vite 7 baseline

<!-- pipeline:claim c002 -->
<!-- pipeline:claim c009 -->

Check the Node version on your workstation, build runner and container image. The Vite 8 release tested here declares `^20.19.0 || >=22.12.0`. If CI needs a new Node version, try it with the old lockfile first. Check the production runtime separately if it runs an SSR bundle. [Vite package manifest](https://github.com/vitejs/vite/blob/v8.4.1/packages/vite/package.json)

Keep a known-good release and record its commit, lockfile, build mode, public `base` and deployment runtime. Capture the built HTML and any manifests or asset lists the server consumes. Pick a route with a lazy import and a style or asset that loads with it. If the app renders on the server, use a direct request to that route and record the expected HTML and the interaction that confirms hydration.

Commit the Vite version and lockfile update together. In an npm project, `npm install -D --save-exact vite@8.4.1` pins the dependency tested in this guide. Verify a clean checkout with `npm ci` and keep any install options the lockfile depends on. Check the resolved framework and plugin versions so an unrelated dependency update does not obscure a regression. [npm clean install reference](https://docs.npmjs.com/cli/v11/commands/npm-ci/)

## Migration notes for Vite config

<!-- pipeline:claim c003 -->
<!-- pipeline:claim c006 -->

Search your config and build scripts for `rollupOptions`, `esbuild`, `commonjsOptions`, `manualChunks` and package-specific aliases. Migrate the settings you actually use. Start with the setting that explains a failed check so the diff stays easy to review.

### Quick decision table

| If the Vite 7 app relies on | Change to try in Vite 8 | Check before you merge |
|---|---|---|
| Custom inputs or output paths | Move compatible settings from `build.rollupOptions` to `build.rolldownOptions`. For a worker bundle, move them from `worker.rollupOptions` to `worker.rolldownOptions`. | Load the built entries from the production public path. |
| A Vite plugin that transforms worker code | Keep the plugin in the `worker.plugins` factory and return fresh plugin instances for each worker build. [Vite worker options](https://v8.vite.dev/config/worker-options#worker-plugins) | Start the worker from the production build and check the value its transform produces. |
| esbuild options or an optimizer plugin | Review `oxc` for source transforms and `optimizeDeps.rolldownOptions` for dependency pre-bundling. The optimizer's esbuild plugin conversion is partial. | Run Vite with `--force` and open a page that imports the affected dependency. Also run the production build. |
| `build.commonjsOptions` to make a dependency load | That option has no effect in Vite 8. Exercise the same import and check the dependency's available ESM entry or the shape of its CommonJS export. | Check the import in development, the built browser app and the built server wherever it is used. |
| An object in `output.manualChunks` | Try automatic splitting first. For a required chunk group, configure `output.codeSplitting.groups`. Function-form `manualChunks` is deprecated too. | Open the lazy route directly and through client navigation. Check side effects, preload links and asset size budgets. |
| The default browser target | Pin the browser targets you still support. The defaults moved from Chrome and Edge 107 to 111, Firefox 104 to 114 and Safari 16.0 to 16.4. | Run your oldest supported browser against the built app. |

Check the option mappings before you move custom settings. If you restore explicit chunk groups, check how they affect module evaluation order. [Vite migration guide](https://vite.dev/guide/migration.html) · [Rolldown chunking guide](https://rolldown.rs/in-depth/manual-code-splitting)

This config keeps an existing `/portal/` base and lazy-chunk filename pattern. It pins the old browser targets for an app that still supports them. Keep your actual values when you apply the same edit.

```ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  base: '/portal/',
  build: {
    manifest: true,
    target: ['chrome107', 'edge107', 'firefox104', 'safari16'],
    rolldownOptions: {
      output: { chunkFileNames: 'assets/lazy-[name]-[hash].js' },
    },
  },
})
```

For Vue, import `vue` from `@vitejs/plugin-vue` and use `vue()` in the plugin array. A backend that builds its own HTML should read `.vite/manifest.json` from the client output when it writes stylesheet, script and preload URLs. When layout changes only in production, check the emitted stylesheet too. Vite 8 uses Lightning CSS for CSS minification by default. [Backend asset integration](https://v8.vite.dev/guide/backend-integration)

## Keep framework and custom plugin changes small

<!-- pipeline:claim c004 -->
<!-- pipeline:claim c005 -->

**React.** Keep a compatible `@vitejs/plugin-react` v5 release for the Vite change if your config passes Babel options to `react()`. The plugin's v6 release removed that option. When you upgrade the plugin, move the required Babel transforms to `@rolldown/plugin-babel` and verify a file that depends on them. If you use `@vitejs/plugin-react-swc` for an SWC plugin, confirm its Vite peer range and exercise the SWC transform before changing either tool. Open a stateful component in dev and edit its text to check Fast Refresh. [React plugin changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)

**Vue.** Check both peer ranges for the installed `@vitejs/plugin-vue` release. Keep the existing Vue runtime when the plugin supports it. Exercise a single-file component with scoped CSS, a TypeScript script block and any custom block your app uses. Edit the template and the style separately to check hot updates. If the app has Vue JSX, check `@vitejs/plugin-vue-jsx` separately and run a component that uses its transforms. [Vue plugin changelog](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/CHANGELOG.md)

**Custom plugins.** Give each critical hook a file or output it has to handle. For a loader that emits JavaScript from another file type, check whether it needs to return `moduleType: 'js'`. If a build hook adds a file by assigning a property on `bundle`, switch to `this.emitFile()` and have CI assert the file exists in the output directory. Test development hooks through the dev server and build hooks with a real production build. [Vite plugin API](https://v8.vite.dev/guide/api-plugin)

## Run the built SSR entry

<!-- pipeline:claim c007 -->
<!-- pipeline:claim c008 -->

Use your framework's production build command if it owns the SSR pipeline. For a custom Vite server, build client and server output separately. The fixture uses `vite build --outDir dist/client --ssrManifest` for browser assets and `vite build --ssr src/entry-server.ts --outDir dist/server` for the server entry. Start your app server with the emitted entry and serve the matching client directory under the real base path. If you use SSR preload hints, read `.vite/ssr-manifest.json` from the client output to look up the browser assets for rendered modules. [Vite SSR build guide](https://v8.vite.dev/guide/ssr)

If an import works during development and fails in production, inspect the built server file. For an external dependency, check what the deployment runtime installs and resolves. If the package needs a Vite transform, try adding just that dependency to `ssr.noExternal` and rerun the built server. Vite 8 can preserve `require()` calls to external packages in ESM output, and the default import shape for some CommonJS packages can change. Check the failing import under the production runtime before adding an alias or changing what gets bundled. Match any custom external export conditions in the Node process that starts the server. [SSR resolution options](https://v8.vite.dev/config/ssr-options)

Request the lazy route from a fresh browser session. Check the server HTML, the styles and the interaction that requires hydration. Then navigate there from inside the app. Both paths should load every browser asset they request, including the deferred chunk. Use the actual server or hosting adapter for this check. A static preview only exercises the client build.

## What passed in the test apps

The config ran on Vite 8.4.1 in a React app with a TSX component and a Vue app with a typed single-file component. Both used CSS, a lazy import and a minimal server renderer. The baseline was Vite 7.3.8 with `build.rollupOptions`. The framework plugins stayed fixed. [Vite 7 changelog](https://github.com/vitejs/vite/blob/v7.3.8/packages/vite/CHANGELOG.md) · [Vite 8 changelog](https://github.com/vitejs/vite/blob/v8.4.1/packages/vite/CHANGELOG.md)

The client builds produced manifests pointing to the entry, CSS and lazy chunk. The entry and lazy filenames changed hashes, and the new references under `/portal/` matched files in the output. The SSR preload manifest mapped the lazy module to its emitted browser file. Development SSR and the built server entry rendered the expected heading. The fixture covered transforms, manifest references and Node rendering. Run browser hydration, HMR and custom plugin checks in your own app.

## Switch CI after the release checks pass

Run the clean install, type checks and existing test suite with the same runtime and production settings used in the baseline. Build from scratch once without a restored build cache. Then key dependency and build caches by the lockfile, Node version and runner platform, plus any config or build mode that changes the output. Have CI verify that the emitted manifest resolves to files in the artifact before publishing it. Inspect any differences in entry size and lazy loading against your existing budget.

Promote the new artifact after the plugin checks, supported browsers, direct route request and hydration pass in staging. For a client-only app, verify the host's direct-route fallback and public asset path. Keep the previous release available with its HTML or SSR server, manifests and hashed assets. A rollback restores that release together. Keep referenced assets available for browsers that still hold older HTML. If CI must rebuild the previous release, restore its config, package manifest and lockfile together.

Stay on the pinned Vite 7 release if a required plugin fails, a supported browser cannot load the bundle or the production server cannot start. Reproduce the failure using one route or plugin input first. If you need to isolate the bundler swap from the other Vite 8 changes, Vite documents `rolldown-vite` as an intermediate test on Vite 7. Return to the full release checks before switching CI. [Gradual migration notes](https://vite.dev/guide/migration.html#gradual-migration)

## Related guides

- If your project still needs the prior major upgrade, start with the [Vite 7 migration guide for React and Vue](/guides/vite-7-migration-guide-react-vue-2026).
- For an app still built by Webpack, use the [Webpack to Vite migration guide](/guides/webpack-to-vite-migration-large-codebases-2026).
- For plugin authors supporting multiple bundlers, see the [guide to unplugin, Rollup and Vite plugins](/guides/unplugin-vs-rollup-plugin-vs-vite-plugin-universal-2026).
- For tests that exercise the built app in a browser, see the [Vitest, Jest and Playwright testing guide](/guides/vitest-jest-playwright-complete-testing-stack-2026).
- Track releases on the [Vite package page](/packages/vite).

## Source notes

<!-- pipeline:source s001 -->
<!-- pipeline:source s002 -->
<!-- pipeline:source s003 -->
<!-- pipeline:source s004 -->
<!-- pipeline:source s005 -->
<!-- pipeline:source s006 -->
<!-- pipeline:source s007 -->
<!-- pipeline:source s008 -->
<!-- pipeline:source s009 -->
<!-- pipeline:source s010 -->
<!-- pipeline:source s011 -->
<!-- pipeline:source s012 -->
<!-- pipeline:source s013 -->
<!-- pipeline:source s014 -->
<!-- pipeline:source s015 -->
<!-- pipeline:source s016 -->
<!-- pipeline:source s017 -->

- The config and browser target details come from the [migration reference at the tested release](https://github.com/vitejs/vite/blob/v8.4.1/docs/guide/migration.md) and the [Vite dependency pre-bundling guide](https://v8.vite.dev/guide/dep-pre-bundling).
- The [React plugin registry manifest](https://registry.npmjs.org/@vitejs%2fplugin-react/5.2.0) and [Vue plugin registry manifest](https://registry.npmjs.org/@vitejs%2fplugin-vue/6.1.1) list the peer support for the plugin versions used in the fixture.
