mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix: hmr with runtimeChunk single
This commit is contained in:
@@ -91,15 +91,22 @@ if (module.hot) {
|
||||
return setStatus(hash, 'success', 'Successfully applied update.');
|
||||
};
|
||||
|
||||
const hasUpdate = () => {
|
||||
const requireExists = (path) => {
|
||||
try {
|
||||
__non_webpack_require__(`~/bundle.${__webpack_hash__}.hot-update.json`);
|
||||
__non_webpack_require__(path);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
const hasUpdate = () => {
|
||||
return [
|
||||
`~/bundle.${__webpack_hash__}.hot-update.json`,
|
||||
`~/runtime.${__webpack_hash__}.hot-update.json`,
|
||||
].some((path) => requireExists(path));
|
||||
};
|
||||
|
||||
const originalOnLiveSync = global.__onLiveSync;
|
||||
global.__onLiveSync = async function () {
|
||||
logVerbose('LiveSync');
|
||||
|
||||
Reference in New Issue
Block a user