NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2055 most downloaded on npm
Speed up your Vite dev server with SWC
Last release 2 months ago
30 Jul 2026
Release timing varies
gaps range from 8 days to 3 months
Nearly every release is documented
notes for 30 of 32 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
39 releases · first in 2022
One column per quarter.
Added a patch so that this plugin works with the experimental bundled dev mode. Note that because this Vite feature is experimental, compatibility in
Added a patch so that this plugin works with the experimental bundled dev mode. Note that because this Vite feature is experimental, compatibility in future Vite releases is not guaranteed.
This project publishes no release notes. Between v4.3.2 and v4.3.3 there were 3 commits, 3 of them substantive:
react-dom in optimizeOps to handle CJS script. (#375)This project publishes no release notes. Between v4.3.1 and v4.3.2 there were 6 commits, 5 of them substantive:
### Avoid esbuild warnings with Vite 8 #1195 Fixes #1187.
This project publishes no release notes. Between v4.3.0 and v4.3.1 there were 4 commits, 4 of them substantive:
This plugin is compatible with Vite 8.
This plugin is compatible with Vite 8.
This project publishes no release notes. Between v4.2.1 and v4.3.0 there were 10 commits, 5 of them substantive:
context from render (#276)Nothing published for this version
rolldown-vite will remove optimizeDeps.rollupOptions in favor of optimizeDeps.rolldownOptions soon. This plugin now uses optimizeDeps.rolldownOptions
rolldown-vite (#978)rolldown-vite will remove optimizeDeps.rollupOptions in favor of optimizeDeps.rolldownOptions soon. This plugin now uses optimizeDeps.rolldownOptions to support newer rolldown-vite. Please update rolldown-vite to the latest version if you are using an older version.
### Fix @vitejs/plugin-react-swc/preamble on build
@vitejs/plugin-react-swc/preamble on build (#962)This project publishes no release notes. Between v4.2.0 and v4.2.1 there were 7 commits, 3 of them substantive:
SSR applications can now initialize HMR runtime by importing @vitejs/plugin-react-swc/preamble at the top of their client entry instead of manually ca
@vitejs/plugin-react-swc/preamble virtual module for SSR HMR (#890)SSR applications can now initialize HMR runtime by importing @vitejs/plugin-react-swc/preamble at the top of their client entry instead of manually calling transformIndexHtml. This simplifies SSR setup for applications that don't use the transformIndexHtml API.
Previously, this plugin did not use SWC if plugins were not provided even if useAtYourOwnRisk_mutateSwcOptions was provided. This is now fixed.
This project publishes no release notes. Between v4.1.0 and v4.2.0 there were 20 commits, 11 of them substantive:
This is set to {viteCacheDir}/swc and override the default of .swc.
This is set to {viteCacheDir}/swc and override the default of .swc.
optimizeDeps.rollupOptions.jsx is going to be deprecated in favor of optimizeDeps.rollupOptions.transform.jsx.
optimizeDeps.rollupOptions.transform.jsx instead of optimizeDeps.rollupOptions.jsx for rolldown-vite (#735)optimizeDeps.rollupOptions.jsx is going to be deprecated in favor of optimizeDeps.rollupOptions.transform.jsx.
Nothing published for this version
This plugin now requires Node 20.19+ or 22.12+.
This plugin now requires Node 20.19+ or 22.12+.
HMR now works for compound components like this:
HMR now works for compound components like this:
const Root = () => <div>Accordion Root</div>
const Item = () => <div>Accordion Item</div>
export const Accordion = { Root, Item }
Plugin[] instead of PluginOption[] (#537)The return type has changed from react(): PluginOption[] to more specialized type react(): Plugin[]. This allows for type-safe manipulation of plugins, for example:
// previously this causes type errors
react()
.map(p => ({ ...p, applyToEnvironment: e => e.name === 'client' }))
This suppresses the warning about optimizeDeps.esbuildOptions being deprecated in rolldown-vite.
@vitejs/plugin-react-oxc if rolldown-vite is detected #491Emit a log which recommends @vitejs/plugin-react-oxc when rolldown-vite is detected to improve performance and use Oxc under the hood. The warning can be disabled by setting disableOxcRecommendation: true in the plugin options.
optimizeDeps.rollupOptions instead of optimizeDeps.esbuildOptions for rolldown-vite #489This suppresses the warning about optimizeDeps.esbuildOptions being deprecated in rolldown-vite.
React plugins are compatible with Vite 7, this removes the warning when testing the beta.
This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
This fixes an edge case when using HTML minifiers that strips line breaks aggressively.
Added filter so that it is more performant when running this plugin with rolldown-powered version of Vite.
filter for rolldown-vite #470Added filter so that it is more performant when running this plugin with rolldown-powered version of Vite.
This was causing annoying Sourcemap for "/@react-refresh" points to missing source files and is unnecessary in test mode.
This removes the HMR warning for hooks with JSX.
This plugin is now compatible with rolldown-powered version of Vite.
This plugin is now compatible with rolldown-powered version of Vite.
Add reactRefreshHost option to set a React Fast Refresh runtime URL prefix. This is useful in a module federation context to enable HMR by specifying
reactRefreshHost optionAdd reactRefreshHost option to set a React Fast Refresh runtime URL prefix.
This is useful in a module federation context to enable HMR by specifying the host application URL in the Vite config of a remote application.
See full discussion here: https://github.com/module-federation/vite/issues/183#issuecomment-2751825367
export default defineConfig({
plugins: [react({ reactRefreshHost: 'http://localhost:3000' })],
})
Nothing published for this version
SWC is now supported in WebContainers 🎉
SWC is now supported in WebContainers 🎉
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
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";
},
});
Revert the throw when refresh runtime is loaded twice to enable usage in micro frontend apps. This was added to help fix setup usage, and this is not
Thanks @RobinTail
Revert the throw when refresh runtime is loaded twice to enable usage in micro frontend apps. This was added to help fix setup usage, and this is not worth an annoying warning for others or a config parameter.
This revert was done in the Babel plugin last year and I didn't port it back.
Ignore directive sourcemap error #231
Ignore directive sourcemap error #231
This is a long overdue and should fix some issues people had with HMR when migrating from CRA.
This is a long overdue and should fix some issues people had with HMR when migrating from CRA.
This will unlock to use the plugin in some use cases where the original source code is not in TS. Using this option to keep using JSX inside .js files
This will unlock to use the plugin in some use cases where the original source code is not in TS. Using this option to keep using JSX inside .js files is highly discouraged and can be removed in any future version.
There were no breaking change that impacted this plugin, so any combination of React plugins and Vite core version will work.
There were no breaking change that impacted this plugin, so any combination of React plugins and Vite core version will work.
This will only affect people using internal libraries that contains untranspiled JSX. This change aligns the optimizer with the source code and avoid issues when the published source don't have React in the scope.
Reminder: While being partially supported in Vite, publishing TS & JSX outside of internal libraries is highly discouraged.
Using CJS in source code will not work in Vite (and will never be supported), so this is better to only use .ts.
.mts (fixes #161)Using CJS in source code will not work in Vite (and will never be supported), so this is better to only use .ts.
But to better align with Vite core defaults, .mts extension will now be processed like .ts. This maybe reverted in a future major.
Add devTarget option (fixes #141)
Support Vitest deps.experimentalOptimizer
Throw an error when the MDX plugin is after this one (#100). This is an expected breaking change added in 3.2.0 and this should people that were using…
type: module to package.json (#101). Because the library already publish .cjs & .mjs files, the only change is for typing when using the node16 module resolution (fixes #95)3.2.0 and this should people that were using both plugins before this version to migrate.Support TS/JSX in node_modules to help the community experiment with it. Note that for now this not supported by TS and errors from these files cannot
"use client" warning when building library like @tanstack/react-queryThis release goes in hand with the upcoming Vite 4.3 release focusing on performances:
Support HMR for MDX (fixes #52)
Support plugins via the new plugins options
plugins optionstsDecorators option. This requires experimentalDecorators in tsconfig.Nothing published for this version
Support Emotion via the new jsxImportSource option (fixes #25)
jsxImportSource option (fixes #25)To use it with Emotion, update your config to:
export default defineConfig({
plugins: [react({ jsxImportSource: "@emotion/react" })],
});
This is plugin is now stable! 🎉
This is plugin is now stable! 🎉
To migrate from vite-plugin-swc-react-refresh, see the 3.0.0-beta.0 changelog.
breaking: update plugin name to vite:react-swc to match official plugins naming
vite:react-swc to match official plugins namingFix package.json exports fields
Fix package.json exports fields
Some breaking changes have been made to make the plugin closer to the Babel one while keeping the smallest API surface possible to reduce bugs, encour…
This is the first beta version of the official plugin for using SWC with React in Vite!
Some breaking changes have been made to make the plugin closer to the Babel one while keeping the smallest API surface possible to reduce bugs, encourage future-proof compilation output and allow easier opt-in into future perf improvements (caching, move to other native toolchain, ...):
.js filesesbuild.define config option to SWC. You can use the top level define option insteadTo migrate, change your config to:
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
export default defineConfig({
plugins: [react()],
});
This new release also include a runtime check for React refresh boundaries. When the conditions are not met (most of the time, exporting React components alongside functions or constant), the module is invalidated with a warning message to help you catch issues while keeping you page up-to date with code changes.
Your coding agent can read these notes before it upgrades. Set up the MCP server →