开发:清理

pull/1881/MERGE
ChenX 2 years ago
parent 03183db25b
commit 8ae3aa11e5

@ -16,6 +16,7 @@ declare const module: WebPackModule;
const requireIndirect = typeof __webpack_require__ !== 'undefined' ? __webpack_require__ : require; const requireIndirect = typeof __webpack_require__ !== 'undefined' ? __webpack_require__ : require;
const makeHotExport = function (sourceModule: WebPackModule): any const makeHotExport = function (sourceModule: WebPackModule): any
{ {
const updateModule = (possibleError?: any) => const updateModule = (possibleError?: any) =>
@ -48,8 +49,7 @@ const makeHotExport = function (sourceModule: WebPackModule): any
{ {
console.error(e); console.error(e);
} }
} });
);
}; };
if (sourceModule.hot) if (sourceModule.hot)
@ -65,9 +65,7 @@ const makeHotExport = function (sourceModule: WebPackModule): any
sourceModule.hot.addStatusHandler(status => sourceModule.hot.addStatusHandler(status =>
{ {
if (status === 'apply') if (status === 'apply')
{
updateModule(); updateModule();
}
}); });
} }
} }
@ -83,10 +81,7 @@ export const HotCMD = function (): (arg0: any) => any
// access parent // access parent
var parent = cache[module.parents[0]]; var parent = cache[module.parents[0]];
if (!parent) if (!parent)
return function (a) return a => a;
{
return a;
};
// remove itself from a cache // remove itself from a cache
delete cache[module.id]; delete cache[module.id];
// setup hot for caller // setup hot for caller
@ -95,6 +90,6 @@ export const HotCMD = function (): (arg0: any) => any
else else
{ {
// prod mode // prod mode
return (a) => a; return a => a;
} }
}();//立即执行 }();//立即执行

Loading…
Cancel
Save