
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
vite-plugin-swc-react-refresh
Advanced tools
Use the versatility of SWC for development and the maturity of esbuild for production
Use the versatility of SWC for development and the maturity of esbuild for production.
npm i -D vite-plugin-swc-react-refresh
With the automatic JSX runtime (requires esbuild => 0.14.51):
import { defineConfig } from "vite";
import { swcReactRefresh } from "vite-plugin-swc-react-refresh";
export default defineConfig({
plugins: [swcReactRefresh()],
esbuild: { jsx: "automatic" },
});
Without the automatic JSX runtime, but still omitting the React default import:
import { defineConfig } from "vite";
import { swcReactRefresh } from "vite-plugin-swc-react-refresh";
export default defineConfig({
plugins: [swcReactRefresh()],
esbuild: { jsxInject: `import React from "react"` },
});
For React refresh to work, your file should only export React components. The best explanation I've read is the one from the Gatsby docs.
However, having some components being hot updated and not others is a very frustrating experience as a developer, and I think this rule should be enforced by a linter, so I made an eslint rule to go along with this plugin.
This plugin expects this rule to be respected and will always fast refresh components. If a file export something that is not a React component (TS types are ok), update to this export would not propagate and require a manual reload.
FAQs
Use the versatility of SWC for development and the maturity of esbuild for production
The npm package vite-plugin-swc-react-refresh receives a total of 464 weekly downloads. As such, vite-plugin-swc-react-refresh popularity was classified as not popular.
We found that vite-plugin-swc-react-refresh demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.