Create React App → Vite
Hours Low riskThe React team deprecated Create React App on February 14, 2025: it has no active maintainers and stays in maintenance mode (React blog ). The same post lists Vite as one of the build tools to move to.
A community codemod handles much of the mechanical work:
npx migrate-to-vite@latest craThis guide walks the rest.
Mushi Mushi keeps working through this migration. The SDK doesn’t
care which bundler ships your app; only the env-var prefix changes
(REACT_APP_* → VITE_*).
Prerequisites
- A working CRA app (
react-scripts≥ 5). - A Node version the current Vite supports (check the Vite guide ).
- Mushi Mushi web SDK or React adapter already installed.
Migration checklist
- Step 01Branch off main
- Step 02Run the codemod
- Step 03Review the diff carefully
- Step 04Rename env vars: REACT_APP_* → VITE_*
- Step 05Move public assets
- Step 06Verify index.html is at the project root
- Step 07Update SVG-as-React-component imports
- Step 08Decide on testing framework
- Step 09Re-verify Mushi Mushi mounts correctly
- Step 10Remove CRA dependencies
- Step 11Update tsconfig.json types
- Step 12Smoke-test dev + prod builds
- Step 13Submit a test Mushi Mushi report
Common gotchas
process.env. Vite doesn’t injectprocess.envat build time. The codemod rewritesprocess.envtoimport.meta.env; grep forREACT_APP_to catch names that still need theVITE_prefix.- Absolute imports without aliases. CRA had implicit absolute imports
via
jsconfig.json/tsconfig.jsonbaseUrl. Vite respectstsconfig.jsonpaths only through a plugin such asvite-tsconfig-pathsor aresolve.aliasentry; add one yourself. - Worker imports. CRA used a webpack-specific
Workerloader; Vite uses native?workerURL imports. The codemod won’t migrate workers for you. @craco/cracousers. If you used craco for custom webpack config, port those overrides tovite.config.tsplugins manually.
Rollback
Branched in step 1, so a git checkout main reverts cleanly. If you’ve
already merged and found an issue after deploying, revert the merge. CRA
still builds; it is deprecated, not removed.
Mushi Mushi compatibility
The Mushi Mushi web SDK and React adapter work the same on CRA and Vite. With
Vite, MushiProvider can also read VITE_MUSHI_PROJECT_ID and
VITE_MUSHI_API_KEY by itself when you don’t pass config.