A tool for migrating your React app from react-scripts (Create React App) to Vite
cd <YOUR_APP>
npx viject
Enables one-shot migration from CRA to Vite. Differences are absorbed in vite.config, allowing for a gradual migration with minimal changes.
See more details in doc
- Rewrite npm scripts
- Add dependencies
- Rewrite
react-app-env.d.ts
- Move
index.html
- Transform
.js
files including JSX into.jsx
- Add
vite.config.(js|ts)
includes plugins for CRA compatibility
- π’ Using HTTPS in Development
- π’ Adding a Stylesheet
- π’ Adding a CSS Modules Stylesheet
- π’ Adding a Sass Stylesheet
- π‘ Adding a CSS Reset (https://create-react-app.dev/docs/adding-css-reset)
- π’ Post-Processing CSS
- π’ Adding Images, Fonts, and Files
- π‘ Loading .graphql Files (https://create-react-app.dev/docs/loading-graphql-files)
- π’ Using the Public Folder
- π’ Code Splitting
- π’ Adding Bootstrap
- π‘ Adding Flow (https://create-react-app.dev/docs/adding-flow)
- π’ Adding TypeScript
- π‘ Adding Relay (https://create-react-app.dev/docs/adding-relay)
- π’ Adding a Router
- π’ Adding Custom Environment Variables
- π‘ Making a Progressive Web App
- π’ Measuring Performance
- π’ Creating a Production Build (https://create-react-app.dev/docs/production-build)
https://vitest.dev/guide/migration.html
- π’ Proxying API Requests in Development (https://create-react-app.dev/docs/proxying-api-requests-in-development)
- π’ Fetching Data with AJAX Requests
- π’ BROWSER
- π‘ BROWSER_ARGS
- π’ HOST
- π’ PORT
- π’ HTTPS
- π« WDS_SOCKET_HOST
- π« WDS_SOCKET_PATH
- π« WDS_SOCKET_PORT
- π’ PUBLIC_URL
- π’ BUILD_PATH
- π« CI
- π« REACT_EDITOR
- π« CHOKIDAR_USEPOLLING
- π’ GENERATE_SOURCEMAP
- π‘ INLINE_RUNTIME_CHUNK
- π‘ IMAGE_INLINE_SIZE_LIMIT
- π’ FAST_REFRESH
- π‘ TSC_COMPILE_ON_ERROR
- π‘ ESLINT_NO_DEV_ERRORS
- π‘ DISABLE_ESLINT_PLUGIN
- π« DISABLE_NEW_JSX_TRANSFORM
MIT