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