You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@vitejs/plugin-react

Package Overview
Dependencies
Maintainers
4
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vitejs/plugin-react - npm Package Compare versions

Comparing version
4.5.1
to
4.5.2
+6
-1
dist/index.cjs

@@ -180,3 +180,3 @@ 'use strict';

},
optimizeDeps: { esbuildOptions: { jsx: "automatic" } }
optimizeDeps: "rolldownVersion" in vite__namespace ? { rollupOptions: { jsx: { mode: "automatic" } } } : { esbuildOptions: { jsx: "automatic" } }
};

@@ -195,2 +195,7 @@ }

const hooks = config.plugins.map((plugin) => plugin.api?.reactBabel).filter(defined);
if ("rolldownVersion" in vite__namespace && !opts.babel && !hooks.length && !opts.disableOxcRecommendation) {
config.logger.warn(
"[vite:react-babel] We recommend switching to `@vitejs/plugin-react-oxc` for improved performance. More information at https://vite.dev/rolldown"
);
}
if (hooks.length > 0) {

@@ -197,0 +202,0 @@ runPluginOverrides = (babelOptions, context) => {

@@ -32,2 +32,6 @@ import { TransformOptions, ParserOptions } from '@babel/core';

reactRefreshHost?: string;
/**
* If set, disables the recommendation to use `@vitejs/plugin-react-oxc`
*/
disableOxcRecommendation?: boolean;
}

@@ -34,0 +38,0 @@ type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'sourceMaps' | 'inputSourceMap'>;

@@ -32,2 +32,6 @@ import { TransformOptions, ParserOptions } from '@babel/core';

reactRefreshHost?: string;
/**
* If set, disables the recommendation to use `@vitejs/plugin-react-oxc`
*/
disableOxcRecommendation?: boolean;
}

@@ -34,0 +38,0 @@ type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'sourceMaps' | 'inputSourceMap'>;

@@ -32,2 +32,6 @@ import { TransformOptions, ParserOptions } from '@babel/core';

reactRefreshHost?: string;
/**
* If set, disables the recommendation to use `@vitejs/plugin-react-oxc`
*/
disableOxcRecommendation?: boolean;
}

@@ -34,0 +38,0 @@ type BabelOptions = Omit<TransformOptions, 'ast' | 'filename' | 'root' | 'sourceFileName' | 'sourceMaps' | 'inputSourceMap'>;

@@ -164,3 +164,3 @@ import { dirname, join } from 'node:path';

},
optimizeDeps: { esbuildOptions: { jsx: "automatic" } }
optimizeDeps: "rolldownVersion" in vite ? { rollupOptions: { jsx: { mode: "automatic" } } } : { esbuildOptions: { jsx: "automatic" } }
};

@@ -179,2 +179,7 @@ }

const hooks = config.plugins.map((plugin) => plugin.api?.reactBabel).filter(defined);
if ("rolldownVersion" in vite && !opts.babel && !hooks.length && !opts.disableOxcRecommendation) {
config.logger.warn(
"[vite:react-babel] We recommend switching to `@vitejs/plugin-react-oxc` for improved performance. More information at https://vite.dev/rolldown"
);
}
if (hooks.length > 0) {

@@ -181,0 +186,0 @@ runPluginOverrides = (babelOptions, context) => {

+6
-6
{
"name": "@vitejs/plugin-react",
"version": "4.5.1",
"version": "4.5.2",
"license": "MIT",

@@ -51,6 +51,6 @@ "author": "Evan You",

"dependencies": {
"@babel/core": "^7.26.10",
"@babel/plugin-transform-react-jsx-self": "^7.25.9",
"@babel/plugin-transform-react-jsx-source": "^7.25.9",
"@rolldown/pluginutils": "1.0.0-beta.9",
"@babel/core": "^7.27.4",
"@babel/plugin-transform-react-jsx-self": "^7.27.1",
"@babel/plugin-transform-react-jsx-source": "^7.27.1",
"@rolldown/pluginutils": "1.0.0-beta.11",
"@types/babel__core": "^7.20.5",

@@ -60,3 +60,3 @@ "react-refresh": "^0.17.0"

"peerDependencies": {
"vite": "^4.2.0 || ^5.0.0 || ^6.0.0"
"vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0"
},

@@ -63,0 +63,0 @@ "devDependencies": {

@@ -132,2 +132,6 @@ # @vitejs/plugin-react [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react.svg)](https://npmjs.com/package/@vitejs/plugin-react)

### disableOxcRecommendation
If set, disables the recommendation to use `@vitejs/plugin-react-oxc` (which is shown when `rolldown-vite` is detected and `babel` is not configured).
## Consistent components exports

@@ -134,0 +138,0 @@