Viject โšก

September 16, 2023 ยท View on GitHub

A tool for migrating your React app from react-scripts (Create React App) to Vite

Usage

node compatibility
cd <YOUR_APP>
npx viject

Concept

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

How it works

  1. Rewrite npm scripts
  2. Add dependencies
  3. Rewrite react-app-env.d.ts
  4. Move index.html
  5. Transform .js files including JSX into .jsx
  6. Add vite.config.(js|ts) includes plugins for CRA compatibility

Supported features

  • ๐ŸŸข Using HTTPS in Development

Styles and Assets

Build

Testing

https://vitest.dev/guide/migration.html

Back-End Integration

Advanced Configuration

https://create-react-app.dev/docs/advanced-configuration

  • ๐ŸŸข 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

Contribution

See Contributing Guide

License

MIT