Replace process.env.REACT_APP_* with import.meta.env.VITE_*

Proprietary

Rewrites reads of process.env.REACT_APP_* to import.meta.env.VITE_*, which is how Vite exposes client environment variables. Files that declare their own process, computed or destructured access, and Node-side config files, and files outside the package's src/ folder, are left unchanged. Each renamed variable is recorded in a data table, because values set outside the repository's .env files must be renamed too.

org.openrewrite.react.cra-to-vite.rename-process-env-react-app
mod run . --recipe=org.openrewrite.react.cra-to-vite.rename-process-env-react-app

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