A React-specific configuration preset for Vite that bundles multiple plugins and settings into a single dependency. Latest version 5.0.0 requires Vite ^7 and Node ^20.19.0 || >=22.12.0. Active development with major releases aligning with Vite's major versions. Key differentiators: automatically includes @vitejs/plugin-react-swc (or babel), sass/less preprocessors, path alias resolution from tsconfig, auto-generated HTTPS certificates, CSS modules with development-friendly names, legacy browser support via @vitejs/plugin-legacy, and QR code for mobile preview. Only supports ESM since v4.0.0.
npm install vite-reactNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Minimal vite.config.mts showing enhanced defineConfig with react, legacy, and server options.
Update vite to ^7 and vite-react to ^5.0.0.
Use ESM imports (import/export). Add 'type': 'module' in package.json or rename config to .mts/.mjs.
Update vite to ^6 for v4.x.
Use vite ^5 for v3.x.
Remove manual react plugin configuration. Use vite-react's react option instead.
Ensure tsconfig.json has paths configured correctly. Plugin watches tsconfig for changes.
Run 'npm install vite' or 'pnpm add vite'.
Use import syntax. Add 'type': 'module' to package.json, or rename file to .mjs.
Change import to: import { defineConfig } from 'vite-react'Ensure vite-react is installed. If issues persist, manually install @vitejs/plugin-react-swc as devDependency.
No dependency data recorded yet.