@vitejs/plugin-react 5.1.1 → 5.1.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.
- package/dist/index.js +7 -7
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -101,7 +101,7 @@ function viteReact(opts = {}) {
|
|
|
101
101
|
let projectRoot = process.cwd();
|
|
102
102
|
let skipFastRefresh = true;
|
|
103
103
|
let base;
|
|
104
|
-
let
|
|
104
|
+
let isBundledDev = false;
|
|
105
105
|
let runPluginOverrides;
|
|
106
106
|
let staticBabelOptions;
|
|
107
107
|
const importReactRE = /\bimport\s+(?:\*\s+as\s+)?React\b/;
|
|
@@ -142,7 +142,7 @@ function viteReact(opts = {}) {
|
|
|
142
142
|
configResolved(config) {
|
|
143
143
|
runningInVite = true;
|
|
144
144
|
base = config.base;
|
|
145
|
-
if (config.experimental.
|
|
145
|
+
if (config.experimental.bundledDev) isBundledDev = true;
|
|
146
146
|
projectRoot = config.root;
|
|
147
147
|
isProduction = config.isProduction;
|
|
148
148
|
skipFastRefresh = isProduction || config.command === "build" || config.server.hmr === false;
|
|
@@ -284,12 +284,12 @@ function viteReact(opts = {}) {
|
|
|
284
284
|
if (userConfig.server?.hmr === false) return { oxc: { jsx: { refresh: false } } };
|
|
285
285
|
}
|
|
286
286
|
};
|
|
287
|
-
const
|
|
287
|
+
const viteReactRefreshBundledDevMode = {
|
|
288
288
|
name: "vite:react-refresh-fbm",
|
|
289
289
|
enforce: "pre",
|
|
290
290
|
transformIndexHtml: {
|
|
291
291
|
handler() {
|
|
292
|
-
if (!skipFastRefresh &&
|
|
292
|
+
if (!skipFastRefresh && isBundledDev) return [{
|
|
293
293
|
tag: "script",
|
|
294
294
|
attrs: { type: "module" },
|
|
295
295
|
children: getPreambleCode(base)
|
|
@@ -329,7 +329,7 @@ function viteReact(opts = {}) {
|
|
|
329
329
|
}
|
|
330
330
|
},
|
|
331
331
|
transformIndexHtml() {
|
|
332
|
-
if (!skipFastRefresh && !
|
|
332
|
+
if (!skipFastRefresh && !isBundledDev) return [{
|
|
333
333
|
tag: "script",
|
|
334
334
|
attrs: { type: "module" },
|
|
335
335
|
children: getPreambleCode(base)
|
|
@@ -341,12 +341,12 @@ function viteReact(opts = {}) {
|
|
|
341
341
|
...isRolldownVite ? [
|
|
342
342
|
viteRefreshWrapper,
|
|
343
343
|
viteConfigPost,
|
|
344
|
-
|
|
344
|
+
viteReactRefreshBundledDevMode
|
|
345
345
|
] : [],
|
|
346
346
|
viteReactRefresh,
|
|
347
347
|
virtualPreamblePlugin({
|
|
348
348
|
name: "@vitejs/plugin-react/preamble",
|
|
349
|
-
isEnabled: () => !skipFastRefresh && !
|
|
349
|
+
isEnabled: () => !skipFastRefresh && !isBundledDev
|
|
350
350
|
})
|
|
351
351
|
];
|
|
352
352
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitejs/plugin-react",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Evan You",
|
|
6
6
|
"description": "The default Vite plugin for React projects",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@babel/core": "^7.28.5",
|
|
48
48
|
"@babel/plugin-transform-react-jsx-self": "^7.27.1",
|
|
49
49
|
"@babel/plugin-transform-react-jsx-source": "^7.27.1",
|
|
50
|
-
"@rolldown/pluginutils": "1.0.0-beta.
|
|
50
|
+
"@rolldown/pluginutils": "1.0.0-beta.53",
|
|
51
51
|
"@types/babel__core": "^7.20.5",
|
|
52
52
|
"react-refresh": "^0.18.0"
|
|
53
53
|
},
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@vitejs/react-common": "workspace:*",
|
|
59
59
|
"babel-plugin-react-compiler": "19.1.0-rc.3",
|
|
60
|
-
"react": "^19.2.
|
|
61
|
-
"react-dom": "^19.2.
|
|
62
|
-
"rolldown": "1.0.0-beta.
|
|
63
|
-
"tsdown": "^0.
|
|
60
|
+
"react": "^19.2.1",
|
|
61
|
+
"react-dom": "^19.2.1",
|
|
62
|
+
"rolldown": "1.0.0-beta.53",
|
|
63
|
+
"tsdown": "^0.17.1"
|
|
64
64
|
}
|
|
65
65
|
}
|