PL

Plugin React Swc

@vitejs/plugin-react-swc

Speed up your Vite dev server with SWC

Utilities
fast refresh
react
react-refresh
swc
vite
vite-plugin
@vitejs/plugin-react-swc
Utilities
javascript
npm
Stars
767
Weekly
7.4M
Open issues
10
Bundle
~15 kB

Installation

npm install @vitejs/plugin-react-swc

Code example

import { usePluginReactSwc } from "@vitejs/plugin-react-swc";

export function Example() {
  const value = usePluginReactSwc();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by Arnaud Barré
  • 7.4M weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~15 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 10 open issues on GitHub

FAQs

Alternatives & similar libraries