@rsbuild/core 1.3.20 → 1.3.22

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.
@@ -1 +1 @@
1
- {"name":"tinyglobby","author":"Superchupu","version":"0.2.13","funding":{"url":"https://github.com/sponsors/SuperchupuDev"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"tinyglobby","author":"Superchupu","version":"0.2.14","funding":{"url":"https://github.com/sponsors/SuperchupuDev"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -62,20 +62,23 @@ function handleErrors(param) {
62
62
  if (createOverlay) createOverlay(html);
63
63
  }
64
64
  const isUpdateAvailable = ()=>lastCompilationHash !== __webpack_hash__;
65
+ const handleApplyUpdates = (err, updatedModules)=>{
66
+ const forcedReload = err || !updatedModules;
67
+ if (forcedReload) {
68
+ if (err) console.error('[HMR] Forced reload caused by: ', err);
69
+ reloadPage();
70
+ return;
71
+ }
72
+ if (isUpdateAvailable()) tryApplyUpdates();
73
+ };
65
74
  function tryApplyUpdates() {
66
75
  if (!isUpdateAvailable()) return;
67
- if (!import.meta.webpackHot) return void reloadPage();
68
- if ('idle' !== import.meta.webpackHot.status()) return;
69
- const handleApplyUpdates = (err, updatedModules)=>{
70
- const forcedReload = err || !updatedModules;
71
- if (forcedReload) {
72
- if (err) console.error('[HMR] Forced reload caused by: ', err);
73
- reloadPage();
74
- return;
75
- }
76
- if (isUpdateAvailable()) tryApplyUpdates();
77
- };
78
- import.meta.webpackHot.check(true).then((updatedModules)=>handleApplyUpdates(null, updatedModules), (err)=>handleApplyUpdates(err, null));
76
+ if (import.meta.webpackHot) {
77
+ if ('idle' !== import.meta.webpackHot.status()) return;
78
+ import.meta.webpackHot.check(true).then((updatedModules)=>handleApplyUpdates(null, updatedModules), (err)=>handleApplyUpdates(err, null));
79
+ return;
80
+ }
81
+ reloadPage();
79
82
  }
80
83
  let connection = null;
81
84
  let reconnectCount = 0;