mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-14 18:12:09 +08:00
fix(hmr): emit boot log at boot instead of the 1st livesync
This commit is contained in:

committed by
Nathan Walker

parent
c450d0ad2a
commit
5a00438321
@ -5,6 +5,7 @@
|
||||
|
||||
if (module.hot) {
|
||||
let hash = __webpack_require__.h();
|
||||
let hmrBootEmittedSymbol = Symbol.for('HMRBootEmitted');
|
||||
|
||||
const logVerbose = (title: string, ...info: any) => {
|
||||
if (__NS_ENV_VERBOSE__) {
|
||||
@ -115,12 +116,15 @@ if (module.hot) {
|
||||
return false;
|
||||
}
|
||||
|
||||
await checkAndApply();
|
||||
await originalOnLiveSync();
|
||||
|
||||
if (!global.hmrBootEmitted) {
|
||||
global.hmrBootEmitted = true;
|
||||
setStatus(hash, 'boot', 'HMR Enabled - waiting for changes...');
|
||||
if (!(await checkAndApply())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
await originalOnLiveSync();
|
||||
};
|
||||
|
||||
if (!global[hmrBootEmittedSymbol]) {
|
||||
global[hmrBootEmittedSymbol] = true;
|
||||
setStatus(hash, 'boot', 'HMR Enabled - waiting for changes...');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user