mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 11:01:21 +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) {
|
if (module.hot) {
|
||||||
let hash = __webpack_require__.h();
|
let hash = __webpack_require__.h();
|
||||||
|
let hmrBootEmittedSymbol = Symbol.for('HMRBootEmitted');
|
||||||
|
|
||||||
const logVerbose = (title: string, ...info: any) => {
|
const logVerbose = (title: string, ...info: any) => {
|
||||||
if (__NS_ENV_VERBOSE__) {
|
if (__NS_ENV_VERBOSE__) {
|
||||||
@ -115,12 +116,15 @@ if (module.hot) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
await checkAndApply();
|
if (!(await checkAndApply())) {
|
||||||
await originalOnLiveSync();
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!global.hmrBootEmitted) {
|
await originalOnLiveSync();
|
||||||
global.hmrBootEmitted = true;
|
};
|
||||||
|
|
||||||
|
if (!global[hmrBootEmittedSymbol]) {
|
||||||
|
global[hmrBootEmittedSymbol] = true;
|
||||||
setStatus(hash, 'boot', 'HMR Enabled - waiting for changes...');
|
setStatus(hash, 'boot', 'HMR Enabled - waiting for changes...');
|
||||||
}
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user