@vitejs/plugin-react-swc weekly downloads statistics
By vitejs (9 listings) · npm · Vite plugins
Speed up your Vite dev server with SWC
@vitejs/plugin-react-swc has 4,799,134 recorded weekly downloads on npm, a decrease of 52.5% over the past 30 days.
It ranks #131 of 2,251 tracked npm listings by weekly downloads.
Over 90 days, weekly downloads changed by -62.3%.
PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.
About @vitejs/plugin-react-swc
@vitejs/plugin-react-swc
Speed up your Vite dev server with SWC
• ✅ A fast Fast Refresh (~20x faster than Babel) • ✅ Enable automatic JSX runtime
Installation
Usage
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"
tsDecorators
Enable TypeScript decorators. Requires experimentalDecorators in tsconfig.
@default false
plugins
Use SWC plugins. Enable SWC at build time.
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"
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.
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:
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.
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).
@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:
Alternatively, you can manually call transformIndexHtml during SSR, which sets up equivalent initialization code. Here's an example for an Express server:
Otherwise, you'll get the following error:
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
Where @vitejs/plugin-react-swc sits in the listing
Each band is one page of 20. Weekly downloads on a log 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.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
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.
Recent observations
Full history (121)Similar npm Vite plugins plugins
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 Oct 18, 2026. See the methodology.