@vitejs/plugin-react 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -162,7 +162,7 @@ function viteReact(opts = {}) {
162
162
  };
163
163
  else if (typeof opts.babel !== "function") {
164
164
  staticBabelOptions = createBabelOptions(opts.babel);
165
- if (canSkipBabel(staticBabelOptions.plugins, staticBabelOptions) && skipFastRefresh && (opts.jsxRuntime === "classic" ? isProduction : true)) delete viteBabel.transform;
165
+ if ((isRolldownVite || skipFastRefresh) && canSkipBabel(staticBabelOptions.plugins, staticBabelOptions) && (opts.jsxRuntime === "classic" ? isProduction : true)) delete viteBabel.transform;
166
166
  }
167
167
  },
168
168
  options(options) {
@@ -203,7 +203,7 @@ function viteReact(opts = {}) {
203
203
  reactCompilerPlugin$1 = void 0;
204
204
  }
205
205
  const isJSX = filepath.endsWith("x");
206
- const useFastRefresh = !isRolldownVite && !skipFastRefresh && !ssr && (isJSX || (opts.jsxRuntime === "classic" ? importReactRE.test(code) : code.includes(jsxImportDevRuntime) || code.includes(jsxImportRuntime)));
206
+ const useFastRefresh = !(isRolldownVite || skipFastRefresh) && !ssr && (isJSX || (opts.jsxRuntime === "classic" ? importReactRE.test(code) : code.includes(jsxImportDevRuntime) || code.includes(jsxImportRuntime)));
207
207
  if (useFastRefresh) plugins.push([await loadPlugin("react-refresh/babel"), { skipEnvCheck: true }]);
208
208
  if (opts.jsxRuntime === "classic" && isJSX) {
209
209
  if (!isProduction) plugins.push(await loadPlugin("@babel/plugin-transform-react-jsx-self"), await loadPlugin("@babel/plugin-transform-react-jsx-source"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitejs/plugin-react",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "license": "MIT",
5
5
  "author": "Evan You",
6
6
  "description": "The default Vite plugin for React projects",
@@ -22,7 +22,7 @@
22
22
  "type": "module",
23
23
  "exports": "./dist/index.js",
24
24
  "scripts": {
25
- "dev": "tsdown --watch",
25
+ "dev": "tsdown --watch ./src --watch ../common",
26
26
  "build": "tsdown",
27
27
  "prepublishOnly": "npm run build",
28
28
  "test-unit": "vitest run"
@@ -43,7 +43,7 @@
43
43
  "@babel/core": "^7.28.3",
44
44
  "@babel/plugin-transform-react-jsx-self": "^7.27.1",
45
45
  "@babel/plugin-transform-react-jsx-source": "^7.27.1",
46
- "@rolldown/pluginutils": "1.0.0-beta.32",
46
+ "@rolldown/pluginutils": "1.0.0-beta.34",
47
47
  "@types/babel__core": "^7.20.5",
48
48
  "react-refresh": "^0.17.0"
49
49
  },
@@ -55,8 +55,8 @@
55
55
  "babel-plugin-react-compiler": "19.1.0-rc.2",
56
56
  "react": "^19.1.1",
57
57
  "react-dom": "^19.1.1",
58
- "rolldown": "1.0.0-beta.32",
59
- "tsdown": "^0.14.1",
58
+ "rolldown": "1.0.0-beta.34",
59
+ "tsdown": "^0.14.2",
60
60
  "vitest": "^3.2.4"
61
61
  }
62
62
  }