Skip to content

Commit 5a00438

Browse files
rigor789NathanWalker
authored andcommitted
fix(hmr): emit boot log at boot instead of the 1st livesync
1 parent c450d0a commit 5a00438

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

packages/webpack5/src/loaders/nativescript-hot-loader/hmr.runtime.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
if (module.hot) {
77
let hash = __webpack_require__.h();
8+
let hmrBootEmittedSymbol = Symbol.for('HMRBootEmitted');
89

910
const logVerbose = (title: string, ...info: any) => {
1011
if (__NS_ENV_VERBOSE__) {
@@ -115,12 +116,15 @@ if (module.hot) {
115116
return false;
116117
}
117118

118-
await checkAndApply();
119-
await originalOnLiveSync();
120-
121-
if (!global.hmrBootEmitted) {
122-
global.hmrBootEmitted = true;
123-
setStatus(hash, 'boot', 'HMR Enabled - waiting for changes...');
119+
if (!(await checkAndApply())) {
120+
return false;
124121
}
122+
123+
await originalOnLiveSync();
125124
};
125+
126+
if (!global[hmrBootEmittedSymbol]) {
127+
global[hmrBootEmittedSymbol] = true;
128+
setStatus(hash, 'boot', 'HMR Enabled - waiting for changes...');
129+
}
126130
}

0 commit comments

Comments
 (0)