Skip to content
PluginStats

@vitejs/plugin-react weekly downloads statistics

By vitejs (9 listings) · npm · Vite plugins

The default Vite plugin for React projects

View on npm Stale · Oct 18, 2026

@vitejs/plugin-react has 59,838,378 recorded weekly downloads on npm, a decrease of 27.3% over the past 30 days, ranking #5 of 2,391 tracked listings.

Weekly downloads
59,838,378
Official API · Oct 18, 2026
7-day growth
-38.5%
-37.4M weekly downloads
30-day growth
-27.3%
-22.5M weekly downloads
90-day growth
-20.2%
-15.1M weekly downloads
Rank
#5
Among tracked npm listings

About @vitejs/plugin-react

@vitejs/plugin-react npm

The default Vite plugin for React projects.

// vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
})

Options

include

Includes .js, .jsx, .ts & .tsx by default. This option can be used to add fast refresh to .mdx files:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import mdx from '@mdx-js/rollup'

export default defineConfig({
  plugins: [
    { enforce: 'pre', ...mdx() },
    react({ include: /\.(mdx|js|jsx|ts|tsx)$/ }),
  ],
})
exclude

The default value is /node_modules/. You may use it to exclude JSX/TSX files that runs in a worker or are not React files. Except if explicitly desired, you should keep node_modules in the exclude list:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [
    react({ exclude: [/\/pdf\//, /\.solid\.tsx$/, /\/node_modules\//] }),
  ],
})
jsxImportSource

Control where the JSX factory is imported from. By default, this is inferred from jsxImportSource from corresponding a tsconfig file for a transformed file.

react({ jsxImportSource: '@emotion/react' })
jsxRuntime

By default, the plugin uses the automatic JSX runtime. However, if you encounter any issues, you may opt out using the jsxRuntime option.

react({ jsxRuntime: 'classic' })
reactRefreshHost

The reactRefreshHost option is only necessary in a module federation context. It enables HMR to work between a remote & host application. In your remote Vite config, you would add your host origin:

react({ reactRefreshHost: 'http://localhost:3000' })

Under the hood, this simply updates the React Fash Refresh runtime URL from /@react-refresh to http://localhost:3000/@react-refresh to ensure there is only one Refresh runtime across the whole application. Note that if you define base option in the host application, you need to include it in the option, like: http://localhost:3000/{base}.

React Compiler

Rust React Compiler

[!WARNING] Native React Compiler support is experimental.

The compiler option uses oxc-transform-react, a Rust port of React Compiler, which must be installed as an optional peer dependency:

npm install -D oxc-transform-react
// vite.config.js
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react({ compiler: true })],
})

The compiler option also accepts React Compiler options:

react({ compiler: { compilationMode: 'annotation' } })

Set logDiagnostics to true to log recoverable React Compiler diagnostics through Vite. This option defaults to false. Fatal diagnostics are always logged and fail the transform.

react({ compiler: { logDiagnostics: true } })
Babel React Compiler

React Compiler can also be used through Babel with the exported reactCompilerPreset helper. This requires @rolldown/plugin-babel, babel-plugin-react-compiler, and @babel/core as peer dependencies:

npm install -D @rolldown/plugin-babel @babel/core babel-plugin-react-compiler

If you are using TypeScript with Babel 7, you will also need to install @types/babel__core:

npm install -D @types/babel__core
// vite.config.js
import { defineConfig } from 'vite'
import react, { reactCompilerPreset } from '@vitejs/plugin-react'
import babel from '@rolldown/plugin-babel'

export default defineConfig({
  plugins: [react(), babel({ presets: [reactCompilerPreset()] })],
})

The reactCompilerPreset accepts an optional options object with the following properties:

  • compilationMode — Set to 'annotation' to only compile components annotated with "use memo".
  • target — Set to '17' or '18' to target older React versions (uses react-compiler-runtime instead of react/compiler-runtime).

Additional options can be found in the documentation.

babel({
  presets: [reactCompilerPreset({ compilationMode: 'annotation' })],
})

[!TIP]

reactCompilerPreset is only a convenient helper with a preconfigured filter. You can configure override the filters to fit your project structure or code. For example, if you know a large portion of your files are never React/hook-related or won't benefit from the React Compiler, you can aggressively exclude them via rolldown.filter:

const myPreset = reactCompilerPreset()
myPreset.rolldown.filter.id.exclude = ['src/legacy/**', 'src/utils/**']

babel({
  presets: [myPreset],
})

@vitejs/plugin-react/preamble

The package provides @vitejs/plugin-react/preamble to initialize HMR runtime from client entrypoint for SSR applications which don't use transformIndexHtml API. For example:

// [entry.client.js]
import '@vitejs/plugin-react/preamble'
```…

Description from the npm listing.

  • fast refresh
  • react
  • react-refresh
  • vite
  • vite-plugin

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@vitejs/plugin-react weekly downloads on npm, last 90 days: 59,838,378 weekly downloads as of Oct 18, 2026, -20.2% over 90 days.@vitejs/plugin-reactWeekly downloads on npm · Last 90 days59,838,378downloads / week-20.2% over 90 days40M50M60M70M80M90M100M110M120MJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 23, 2026 – Oct 18, 2026 · 88 observations · Updated Oc…pluginstats.com
@vitejs/plugin-react weekly downloads on npm, last 90 days: 59,838,378 weekly downloads as of Oct 18, 2026, -20.2% over 90 days.

7/30/90-day growth

@vitejs/plugin-react weekly downloads growth on npm: -38.5% over 7 days, -27.3% over 30 days, -20.2% over 90 days.@vitejs/plugin-reactWeekly downloads growth on npm59,838,378downloads / week now7-day growth-37,436,757 weekly downl…-38.5%30-day growth-22,487,774 weekly downl…-27.3%90-day growth-15,106,439 weekly downl…-20.2%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@vitejs/plugin-react weekly downloads growth on npm: -38.5% over 7 days, -27.3% over 30 days, -20.2% over 90 days.

Ranking history

@vitejs/plugin-react npm ranking history: currently #5 (by weekly downloads).@vitejs/plugin-reactnpm ranking · by weekly downloads · Last 90 days#5current rank#3#4#5#6#7Jul 23Aug 7Aug 22Sep 6Sep 21Oct 6Oct 21rankOct 18, 2026 – Oct 21, 2026 · 4 observations · Updated Oct 18, 2026pluginstats.com
@vitejs/plugin-react npm ranking history: currently #5 (by weekly downloads).

Listing placement

All npm2,389 listings · 120 pages · 1,195 shown · page 1, #5 (overall #5)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins257 listings · 13 pages · page 1, #1 (overall #1)
Vite plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for @vitejs/plugin-react
Date (UTC)Weekly downloadsChange vs. previous
59,838,378+11.7M
48,114,108-11.8M
59,890,837+40.9K
59,849,922-19M
78,845,094-17.9M
96,704,4630
96,704,463-570.7K
97,275,135+66.8K
97,208,319-72K
97,280,306+729.9K
96,550,456-699.9K
97,250,325-761.1K
98,011,408-18.9M
116,894,835—

Similar npm Vite plugins plugins

All 20 @vitejs/plugin-react alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@vitejs/plugin-react. First seen Oct 16, 2026; last successful collection Oct 21, 2026. See the methodology.