@vitejs/plugin-react 1.1.2 → 1.1.3
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/CHANGELOG.md +9 -0
- package/dist/index.js +7 -7
- package/package.json +1 -1
- package/src/fast-refresh.ts +7 -7
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## [1.1.3](https://github.com/vitejs/vite/compare/plugin-react@1.1.2...plugin-react@1.1.3) (2021-12-13)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* **plugin-react:** only detect preamble in hmr context ([#6096](https://github.com/vitejs/vite/issues/6096)) ([8735294](https://github.com/vitejs/vite/commit/8735294055ce16308a6b8302eba4538f4a2931d0))
|
7
|
+
|
8
|
+
|
9
|
+
|
1
10
|
## [1.1.2](https://github.com/vitejs/vite/compare/plugin-react@1.1.1...plugin-react@1.1.2) (2021-12-13)
|
2
11
|
|
3
12
|
|
package/dist/index.js
CHANGED
@@ -207,14 +207,14 @@ import RefreshRuntime from "${runtimePublicPath}";
|
|
207
207
|
let prevRefreshReg;
|
208
208
|
let prevRefreshSig;
|
209
209
|
|
210
|
-
if (!window.__vite_plugin_react_preamble_installed__) {
|
211
|
-
throw new Error(
|
212
|
-
"@vitejs/plugin-react can't detect preamble. Something is wrong. " +
|
213
|
-
"See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
|
214
|
-
);
|
215
|
-
}
|
216
|
-
|
217
210
|
if (import.meta.hot) {
|
211
|
+
if (!window.__vite_plugin_react_preamble_installed__) {
|
212
|
+
throw new Error(
|
213
|
+
"@vitejs/plugin-react can't detect preamble. Something is wrong. " +
|
214
|
+
"See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
|
215
|
+
);
|
216
|
+
}
|
217
|
+
|
218
218
|
prevRefreshReg = window.$RefreshReg$;
|
219
219
|
prevRefreshSig = window.$RefreshSig$;
|
220
220
|
window.$RefreshReg$ = (type, id) => {
|
package/package.json
CHANGED
package/src/fast-refresh.ts
CHANGED
@@ -35,14 +35,14 @@ import RefreshRuntime from "${runtimePublicPath}";
|
|
35
35
|
let prevRefreshReg;
|
36
36
|
let prevRefreshSig;
|
37
37
|
|
38
|
-
if (!window.__vite_plugin_react_preamble_installed__) {
|
39
|
-
throw new Error(
|
40
|
-
"@vitejs/plugin-react can't detect preamble. Something is wrong. " +
|
41
|
-
"See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
|
42
|
-
);
|
43
|
-
}
|
44
|
-
|
45
38
|
if (import.meta.hot) {
|
39
|
+
if (!window.__vite_plugin_react_preamble_installed__) {
|
40
|
+
throw new Error(
|
41
|
+
"@vitejs/plugin-react can't detect preamble. Something is wrong. " +
|
42
|
+
"See https://github.com/vitejs/vite-plugin-react/pull/11#discussion_r430879201"
|
43
|
+
);
|
44
|
+
}
|
45
|
+
|
46
46
|
prevRefreshReg = window.$RefreshReg$;
|
47
47
|
prevRefreshSig = window.$RefreshSig$;
|
48
48
|
window.$RefreshReg$ = (type, id) => {
|