vite-plugin-swc
v0.0.2
Published
- [Speedy Compiling in SWC](https://swc.rs/docs/configuring-swc) - HMR Support in React Refresh - [New JSX Transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
Downloads
557
Readme
features
- Speedy Compiling in SWC
- HMR Support in React Refresh
- New JSX Transform
install
yarn add -D vite-plugin-swc-react
// or
npm install -D vite-plugin-swc-react
Usage
import { defineConfig } from 'vite'
import swcReact from 'vite-plugin-swc-react'
export default defineConfig({
plugins: [swcReact()],
})
disable HMR
import { defineConfig } from 'vite'
import swcReact from 'vite-plugin-swc-react'
export default defineConfig({
plugins: [swcReact({
reactFresh: false,
})],
})
classic JSX runtime
import { defineConfig } from 'vite'
import swcReact from 'vite-plugin-swc-react'
export default defineConfig({
plugins: [
swcReact({
swcOptions: {
jsc: {
transform: {
react: {
runtime: 'classic',
},
},
},
},
}),
],
})