@vitejs/plugin-react
The official Vite plugin for React with Babel-powered Fast Refresh and JSX transforms
Repository Health
Technical Analysis
@vitejs/plugin-react is the default, officially maintained Vite plugin for React projects, enabling JSX/TSX compilation and Babel-based Fast Refresh so component edits update in the browser instantly without losing component state. It is scaffolded automatically by create-vite for every React template and is the plugin most React + Vite projects depend on without ever needing to configure directly.
The plugin lives in the vite-plugin-react monorepo alongside @vitejs/plugin-react-swc (an SWC-based alternative optimized for faster cold starts) and experimental React Server Components tooling (@vitejs/plugin-rsc). @vitejs/plugin-react itself uses Babel, which trades a small amount of transform speed for broader plugin/preset compatibility (including optional React Compiler integration), making it the default recommendation for most projects.
What You Get
- Automatic JSX/TSX transformation for
.jsx/.tsxfiles using Babel during both dev and build - Babel-powered React Fast Refresh, preserving component state across hot module reloads in development
- Configurable Babel plugin/preset injection for custom transforms (e.g. styled-components, emotion)
- Optional integration with the React Compiler (
babel-plugin-react-compiler) via a dedicated preset - Zero-config setup as the default plugin scaffolded by
create-vite’s React templates
Common Use Cases
- Standard React + Vite application development, added automatically via
create-vite --template react - Enabling Fast Refresh so component state survives edits during local development
- Adding custom Babel plugins/presets (e.g. for CSS-in-JS libraries) to a Vite-based React build
- Opting a React codebase into the React Compiler’s automatic memoization via the plugin’s compiler preset
Under The Hood
Architecture: The plugin (packages/plugin-react/src/index.ts) implements Vite’s Plugin interface, transforming matched .[tj]sx? files with Babel and injecting a refresh-runtime.js preamble plus a virtual preamble plugin from the shared @vitejs/react-common package (also used by the SWC sibling plugin-react-swc) so both variants share Fast Refresh wiring logic; a separate reactCompilerPreset.ts composes an optional Babel preset that layers in babel-plugin-react-compiler for projects opting into the compiler. Tech Stack: TypeScript throughout, built as an ESM package consumed by Vite’s plugin pipeline, tested with Vitest, and versioned as one package among several (plugin-react, plugin-react-swc, plugin-rsc, common) in a pnpm-workspace monorepo maintained by the core Vite team (Evan You among the listed authors). Code Quality: The compiler preset ships its own dedicated test file (reactCompilerPreset.test.ts) and the plugin is exercised indirectly by Vite’s own extensive e2e suite across the ecosystem given its status as the default React integration; the small, focused src/ surface (three files) keeps the reviewable footprint minimal for a project this widely depended upon. API Design: The Options interface documents every knob (include/exclude patterns, jsxImportSource, jsxRuntime) with inline JSDoc and sensible defaults, so the overwhelming majority of consumers add react() to their vite.config.ts plugins array with zero configuration.
Used by 211 apps in this directory
Payload CMS
Blogging · CMS · Developer Tools
The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.
Penpot
Design Tools
Open-source design platform with GPU-accelerated canvas, native design tokens, and MCP-powered AI workflows for teams that ship fast.
Arize Phoenix
Analytics · Devops · Monitoring
Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.
Plasmic
CMS · Design Tools · Low Code Platforms
The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.
Polar
Developer Tools · Ecommerce · Invoicing Finance
Open source payments infrastructure that turns software into a business — subscriptions, usage-based billing, digital products, and merchant-of-record compliance in one platform.
Portpal
Developer Tools · Monitoring
A native desktop dashboard that shows every port your machine is listening on, kills the process blocking it in one click, and visualizes how your services are actually connected.
PostHog
Ab Testing Experimentation · Analytics · Developer Tools
The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.
Postiz
Automation · Social Media
The agentic social media scheduler — AI-powered content creation, 33-platform posting, and team workflows, all self-hosted.
Promptfoo
AI Development
An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.