Upgrade to Vite 8

Proprietary

Chains the earlier majors: a project several majors behind needs only this recipe, which also runs the code changes of the earlier majors in order, and upgrades the dependencies once, straight to 8.x, so no intermediate version has to resolve. Upgrade vite to 8.x and the official plugins that must match it in package.json: @vitejs/plugin-react 5.x, @vitejs/plugin-react-swc 4.x, @vitejs/plugin-vue 6.x, @vitejs/plugin-legacy 8.x and @sveltejs/vite-plugin-svelte 7.x. Vite 8 requires Node.js 20.19 or later or 22.12 or later and replaces esbuild and Rollup with Rolldown. In vite.config and vitest.config files it renames rollupOptions to rolldownOptions (MigrateVite8Config) and marks the esbuild, optimizeDeps.esbuildOptions and manualChunks changes that need a decision (FindVite8Changes). Not done by this recipe: raising engines.node, the changes that are only marked, and community plugins.

org.openrewrite.nodejs.migrate.vite.UpgradeToVite8
mod run . --recipe=org.openrewrite.nodejs.migrate.vite.UpgradeToVite8

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.