Migrate Create React App to Vite

Proprietary

Moves a Create React App project to Vite: adds the Vite dependencies, rewrites the start and build scripts (keeping a type check in build when there is a tsconfig.json), adds a Vite config, moves public/index.html to the project root, renames REACT_APP_* variables to VITE_* and points TypeScript at vite/client. react-scripts is removed only when no script such as react-scripts test still runs it. Packages that use craco or react-app-rewired, or whose start or build script wraps react-scripts, are not edited; they and other constructs that need a manual step, such as Jest configuration or SVG ReactComponent imports, are recorded in a data table.

org.openrewrite.react.migrate.cra-to-vite

Optional

The version range of vite to add. Vite 7 needs Node 20.19 or later.

The version range of @vitejs/plugin-react to add. It must accept the vite range above.

mod run . --recipe=org.openrewrite.react.migrate.cra-to-vite

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