mirror of https://github.com/webpack/webpack.git
parent
0c4d69b7c6
commit
27e4d14a31
|
@ -195,8 +195,8 @@ class JsonpMainTemplatePlugin {
|
|||
function hotDisposeChunk(chunkId) {
|
||||
delete installedChunks[chunkId];
|
||||
}
|
||||
var parentHotUpdateCallback = this[${JSON.stringify(hotUpdateFunction)}];
|
||||
this[${JSON.stringify(hotUpdateFunction)}] = ${runtimeSource}`;
|
||||
var parentHotUpdateCallback = window[${JSON.stringify(hotUpdateFunction)}];
|
||||
window[${JSON.stringify(hotUpdateFunction)}] = ${runtimeSource}`;
|
||||
});
|
||||
mainTemplate.plugin("hash", function(hash) {
|
||||
hash.update("jsonp");
|
||||
|
|
|
@ -82,8 +82,8 @@ class WebWorkerMainTemplatePlugin {
|
|||
});
|
||||
|
||||
return source + "\n" +
|
||||
`var parentHotUpdateCallback = this[${JSON.stringify(hotUpdateFunction)}];\n` +
|
||||
`this[${JSON.stringify(hotUpdateFunction)}] = ` +
|
||||
`var parentHotUpdateCallback = window[${JSON.stringify(hotUpdateFunction)}];\n` +
|
||||
`window[${JSON.stringify(hotUpdateFunction)}] = ` +
|
||||
Template.getFunctionContent(require("./WebWorkerMainTemplate.runtime.js"))
|
||||
.replace(/\/\/\$semicolon/g, ";")
|
||||
.replace(/\$require\$/g, this.requireFn)
|
||||
|
|
|
@ -188,8 +188,8 @@ installedChunks[chunkIds.pop()] = 1;
|
|||
it("returns the original source with hot update callback", () => {
|
||||
env.source.should.be.exactly(`
|
||||
moduleSource()
|
||||
var parentHotUpdateCallback = this["webpackHotUpdate"];
|
||||
this["webpackHotUpdate"] = function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
|
||||
var parentHotUpdateCallback = window["webpackHotUpdate"];
|
||||
window["webpackHotUpdate"] = function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars
|
||||
hotAddUpdateChunk(chunkId, moreModules);
|
||||
if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules);
|
||||
} ;
|
||||
|
|
Loading…
Reference in New Issue