Skip to content
PluginStats

@vitejs/plugin-react-swc weekly downloads statistics

By vitejs (9 listings) · npm · Vite plugins

Speed up your Vite dev server with SWC

View on npm Fresh · Dec 6, 2026

@vitejs/plugin-react-swc has 10,843,302 recorded weekly downloads on npm, an increase of 9.4% over the past 30 days, ranking #137 of 3,247 tracked listings.

Weekly downloads
10,843,302
Official API · Dec 5, 2026
7-day growth
+13.5%
+1.3M weekly downloads
30-day growth
+9.4%
+927.5K weekly downloads
90-day growth
+15.0%
+1.4M weekly downloads
Rank
#137
Among tracked npm listings

About @vitejs/plugin-react-swc

@vitejs/plugin-react-swc npm

Speed up your Vite dev server with SWC

Installation

npm i -D @vitejs/plugin-react-swc

Usage

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

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

Caveats

This plugin has limited options to enable good performances and be transpiler agnostic. Here is the list of non-configurable options that impact runtime behaviour:

  • useDefineForClassFields is always activated, as this matches the current ECMAScript spec
  • jsx runtime is always automatic
  • In development:
    • esbuild is disabled, so the esbuild configuration has no effect
    • target is ignored and defaults to es2020 (see devTarget)
    • JS files are not transformed
    • tsconfig is not resolved, so properties other than the ones listed above behaves like TS defaults

Options

jsxImportSource

Control where the JSX factory is imported from.

@default "react"

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

Enable TypeScript decorators. Requires experimentalDecorators in tsconfig.

@default false

react({ tsDecorators: true })
plugins

Use SWC plugins. Enable SWC at build time.

react({ plugins: [['@swc/plugin-styled-components', {}]] })
devTarget

Set the target for SWC in dev. This can avoid to down-transpile private class method for example.

For production target, see https://vite.dev/config/build-options.html#build-target.

@default "es2020"

react({ devTarget: 'es2022' })
parserConfig

Override the default include list (.ts, .tsx, .mts, .jsx, .mdx).

This requires to redefine the config for any file you want to be included (ts, mdx, ...).

If you want to trigger fast refresh on compiled JS, use jsx: true. Exclusion of node_modules should be handled by the function if needed. Using this option to use JSX inside .js files is highly discouraged and can be removed in any future version.

react({
  parserConfig(id) {
    if (id.endsWith('.res')) return { syntax: 'ecmascript', jsx: true }
    if (id.endsWith('.ts')) return { syntax: 'typescript', tsx: false }
  },
})
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}.

useAtYourOwnRisk_mutateSwcOptions

The future of Vite is with OXC, and from the beginning this was a design choice to not exposed too many specialties from SWC so that Vite React users can move to another transformer later. Also debugging why some specific version of decorators with some other unstable/legacy feature doesn't work is not fun, so we won't provide support for it, hence the name useAtYourOwnRisk.

react({
  useAtYourOwnRisk_mutateSwcOptions(options) {
    options.jsc.parser.decorators = true
    options.jsc.transform.decoratorVersion = '2022-03'
  },
})
disableOxcRecommendation

If set, disables the recommendation to use @vitejs/plugin-react (which is shown when rolldown-vite is detected and neither swc plugins are used nor the swc options are mutated).

react({ disableOxcRecommendation: true })

@vitejs/plugin-react-swc/preamble

The package provides @vitejs/plugin-react-swc/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-swc/preamble'

Alternatively, you can manually call transformIndexHtml during SSR, which sets up equivalent initialization code. Here's an example for an Express server:

app.get('/', async (req, res, next) => {
  try {
    let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')

    // Transform HTML using Vite plugins.
    html = await viteServer.transformIndexHtml(req.url, html)

    res.send(html)
  } catch (e) {
    return next(e)
  }
})

Otherwise, you'll get the following error:

Uncaught Error: @vitejs/plugin-react-swc can't detect preamble. Something is wrong.

Consistent components exports

For React refresh to work correctly, your file should only export React components. The best explanation I've read is the one from the Gatsby docs.

If an incompatible change in exports is found, the module will be invalidated and HMR will propagate. To make it easier to export simple constants alongside your component, the module is only invalidated when their value changes.

You can catch mistakes and get more detailed warnings with this ESLint rule, or the equivalent Oxlint rule.

Description from the npm listing.

  • fast refresh
  • react
  • react-refresh
  • swc
  • 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-swc weekly downloads on npm, last 90 days: 10,843,302 weekly downloads as of Dec 5, 2026, +15.0% over 90 days.@vitejs/plugin-react-swcWeekly downloads on npm · Last 90 days10,843,302downloads / week+15.0% over 90 days02M4M6M8M10M12M14MSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@vitejs/plugin-react-swc weekly downloads on npm, last 90 days: 10,843,302 weekly downloads as of Dec 5, 2026, +15.0% over 90 days.

7/30/90-day growth

@vitejs/plugin-react-swc weekly downloads growth on npm: +13.5% over 7 days, +9.4% over 30 days, +15.0% over 90 days.@vitejs/plugin-react-swcWeekly downloads growth on npm10,843,302downloads / week now7-day growth+1,291,226 weekly downlo…+13.5%30-day growth+927,537 weekly downloads+9.4%90-day growth+1,415,114 weekly downlo…+15.0%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@vitejs/plugin-react-swc weekly downloads growth on npm: +13.5% over 7 days, +9.4% over 30 days, +15.0% over 90 days.

Ranking history

@vitejs/plugin-react-swc npm ranking history: currently #137 (by weekly downloads).@vitejs/plugin-react-swcnpm ranking · by weekly downloads · Last 90 days#137current rank#128#130#132#134#136#138#140Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
@vitejs/plugin-react-swc npm ranking history: currently #137 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 7, #17 (overall #137)
All npm: every listing in weekly downloads order

Listing placement

Vite plugins300 listings · 15 pages · page 1, #5 (overall #5)
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 (170)
Recent weekly downloads observations for @vitejs/plugin-react-swc
Date (UTC)Weekly downloadsChange vs. previous
10,843,302+145.5K
10,697,758+421.6K
10,276,129+411.5K
9,864,643+169.2K
9,695,492+173.5K
9,521,970-14.3K
9,536,281-15.8K
9,552,076-160.5K
9,712,621-302.1K
10,014,713-293.5K
10,308,192-163.2K
10,471,354-79.5K
10,550,889-100.9K
10,651,829—

Similar npm Vite plugins plugins

All 20 @vitejs/plugin-react-swc 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-swc. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.