Upgrade to Vite 7

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 7.x, so no intermediate version has to resolve. Upgrade vite to 7.x and the official plugins that must match it in package.json: @vitejs/plugin-react 4.x, @vitejs/plugin-react-swc 3.x, @vitejs/plugin-vue 6.x, @vitejs/plugin-legacy 7.x and @sveltejs/vite-plugin-svelte 6.x. Vite 7 requires Node.js 20.19 or later or 22.12 or later. In vite.config and vitest.config files it drops the removed Sass api option and renames the transformIndexHtml enforce and transform keys (MigrateVite7Config, MigrateTransformIndexHtmlHook) and marks splitVendorChunkPlugin and the legacy Sass API (FindVite7Changes). Not done by this recipe: raising engines.node, the changes that are only marked, and community plugins.

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

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