@vitejs/plugin-react 4.0.2 → 4.0.4
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.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/refreshUtils.js +1 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
@@ -170,7 +170,7 @@ function viteReact(opts = {}) {
|
|
170
170
|
);
|
171
171
|
}
|
172
172
|
}
|
173
|
-
if (!plugins.length && !babelOptions.configFile && !babelOptions.babelrc) {
|
173
|
+
if (!plugins.length && !babelOptions.presets.length && !babelOptions.configFile && !babelOptions.babelrc) {
|
174
174
|
return;
|
175
175
|
}
|
176
176
|
const parserPlugins = [...babelOptions.parserOpts.plugins];
|
package/dist/index.mjs
CHANGED
@@ -150,7 +150,7 @@ function viteReact(opts = {}) {
|
|
150
150
|
);
|
151
151
|
}
|
152
152
|
}
|
153
|
-
if (!plugins.length && !babelOptions.configFile && !babelOptions.babelrc) {
|
153
|
+
if (!plugins.length && !babelOptions.presets.length && !babelOptions.configFile && !babelOptions.babelrc) {
|
154
154
|
return;
|
155
155
|
}
|
156
156
|
const parserPlugins = [...babelOptions.parserOpts.plugins];
|
package/dist/refreshUtils.js
CHANGED
@@ -1,13 +1,3 @@
|
|
1
|
-
/* eslint-disable no-undef */
|
2
|
-
if (typeof window !== 'undefined') {
|
3
|
-
if (window.__vite_plugin_react_runtime_loaded__) {
|
4
|
-
throw new Error(
|
5
|
-
'React refresh runtime was loaded twice. Maybe you forgot the base path?',
|
6
|
-
)
|
7
|
-
}
|
8
|
-
window.__vite_plugin_react_runtime_loaded__ = true
|
9
|
-
}
|
10
|
-
|
11
1
|
function debounce(fn, delay) {
|
12
2
|
let handle
|
13
3
|
return () => {
|
@@ -16,6 +6,7 @@ function debounce(fn, delay) {
|
|
16
6
|
}
|
17
7
|
}
|
18
8
|
|
9
|
+
/* eslint-disable no-undef */
|
19
10
|
const enqueueUpdate = debounce(exports.performReactRefresh, 16)
|
20
11
|
|
21
12
|
// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vitejs/plugin-react",
|
3
|
-
"version": "4.0.
|
3
|
+
"version": "4.0.4",
|
4
4
|
"license": "MIT",
|
5
5
|
"author": "Evan You",
|
6
6
|
"contributors": [
|
@@ -39,7 +39,7 @@
|
|
39
39
|
},
|
40
40
|
"homepage": "https://github.com/vitejs/vite-plugin-react/tree/main/packages/plugin-react#readme",
|
41
41
|
"dependencies": {
|
42
|
-
"@babel/core": "^7.22.
|
42
|
+
"@babel/core": "^7.22.9",
|
43
43
|
"@babel/plugin-transform-react-jsx-self": "^7.22.5",
|
44
44
|
"@babel/plugin-transform-react-jsx-source": "^7.22.5",
|
45
45
|
"react-refresh": "^0.14.0"
|