Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit bb31af5

Browse files
committed
refactor(HMR): add __initialHmrUpdate to global scope
1 parent 911428b commit bb31af5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bundle-config-loader.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ module.exports = function (source) {
55
const hmr = `
66
if (module.hot) {
77
const hmrUpdate = require("nativescript-dev-webpack/hmr").hmrUpdate;
8-
let initialHmrUpdate = true;
8+
global.__initialHmrUpdate = true;
99
global.__hmrSyncBackup = global.__onLiveSync;
1010
1111
global.__onLiveSync = function () {
1212
hmrUpdate();
1313
};
1414
1515
global.hmrRefresh = function({ type, module } = {}) {
16-
if (initialHmrUpdate) {
16+
if (global.__initialHmrUpdate) {
1717
return;
1818
}
1919
@@ -23,7 +23,7 @@ module.exports = function (source) {
2323
};
2424
2525
hmrUpdate().then(() => {
26-
initialHmrUpdate = false;
26+
global.__initialHmrUpdate = false;
2727
})
2828
}
2929
`;

0 commit comments

Comments
 (0)