Skip to content

Commit 743a00a

Browse files
committed
Download hot chunk using importScripts if in a web worker
1 parent 9f440e3 commit 743a00a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/JsonpMainTemplate.runtime.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ module.exports = function() {
1010
}
1111

1212
function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars
13+
if(typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
14+
// In a web worker
15+
try {
16+
importScripts($require$.p + $hotChunkFilename$);
17+
} catch (e) {
18+
console.warn(e);
19+
}
20+
return;
21+
}
22+
1323
var head = document.getElementsByTagName("head")[0];
1424
var script = document.createElement("script");
1525
script.type = "text/javascript";

0 commit comments

Comments
 (0)