Gathering detailed insights and metrics for @vitejs/plugin-react-oxc
Gathering detailed insights and metrics for @vitejs/plugin-react-oxc
Gathering detailed insights and metrics for @vitejs/plugin-react-oxc
Gathering detailed insights and metrics for @vitejs/plugin-react-oxc
The all-in-one Vite plugin for React projects.
npm install @vitejs/plugin-react-oxc
Typescript
Module System
Min. Node Version
Node Version
NPM Version
66.5
Supply Chain
84.7
Quality
92.6
Maintenance
100
Vulnerability
98.2
License
plugin-rsc@0.4.27
Updated on Sep 01, 2025
plugin-rsc@0.4.26
Updated on Aug 29, 2025
plugin-rsc@0.4.25
Updated on Aug 28, 2025
plugin-react@5.0.2
Updated on Aug 28, 2025
plugin-rsc@0.4.24
Updated on Aug 25, 2025
plugin-rsc@0.4.23
Updated on Aug 23, 2025
TypeScript (88.3%)
JavaScript (6.76%)
CSS (3.48%)
HTML (1.37%)
MDX (0.09%)
Total Downloads
39,502
Last Day
1,040
Last Week
11,165
Last Month
34,992
Last Year
39,502
MIT License
868 Stars
1,368 Commits
176 Forks
12 Watchers
19 Branches
54 Contributors
Updated on Sep 03, 2025
Latest Version
0.4.1
Package Id
@vitejs/plugin-react-oxc@0.4.1
Unpacked Size
33.10 kB
Size
11.07 kB
File Count
6
NPM Version
10.8.2
Node Version
20.19.4
Published on
Aug 19, 2025
Cumulative downloads
Total Downloads
Last Day
37.2%
1,040
Compared to previous day
Last Week
34.6%
11,165
Compared to previous week
Last Month
823.5%
34,992
Compared to previous month
Last Year
0%
39,502
Compared to previous year
1
1
3
[!IMPORTANT] This package is deprecated. Please use @vitejs/plugin-react instead, which automatically enables Oxc-based Fast Refresh transform on
rolldown-vite
.
The future default Vite plugin for React projects.
1// vite.config.js 2import { defineConfig } from 'vite' 3import react from '@vitejs/plugin-react-oxc' 4 5export default defineConfig({ 6 plugins: [react()], 7})
jsx runtime
is always automatic
rolldown-vite
Includes .js
, .jsx
, .ts
& .tsx
and excludes /node_modules/
by default. This option can be used to add fast refresh to .mdx
files:
1import { defineConfig } from 'vite' 2import react from '@vitejs/plugin-react' 3import mdx from '@mdx-js/rollup' 4 5export default defineConfig({ 6 plugins: [ 7 { enforce: 'pre', ...mdx() }, 8 react({ include: /\.(mdx|js|jsx|ts|tsx)$/ }), 9 ], 10})
Control where the JSX factory is imported from. Default to 'react'
1react({ jsxImportSource: '@emotion/react' })
In middleware mode, you should make sure your entry index.html
file is transformed by Vite. Here's an example for an Express server:
1app.get('/', async (req, res, next) => {
2 try {
3 let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')
4
5 // Transform HTML using Vite plugins.
6 html = await viteServer.transformIndexHtml(req.url, html)
7
8 res.send(html)
9 } catch (e) {
10 return next(e)
11 }
12})
Otherwise, you'll probably get this error:
Uncaught Error: @vitejs/plugin-react-oxc can't detect preamble. Something is wrong.
For React refresh to work correctly, your file should only export React components. You can find a good explanation in 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 warning with this eslint rule.
No vulnerabilities found.