@vitejs/plugin-react
Advanced tools
+6
-1
@@ -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) => { |
+4
-0
@@ -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'>; |
+4
-0
@@ -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'>; |
+4
-0
@@ -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'>; |
+6
-1
@@ -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": { |
+4
-0
@@ -132,2 +132,6 @@ # @vitejs/plugin-react [](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 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
62948
2.27%1432
0.99%143
2.88%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated