Skip to content

Commit 3483802

Browse files
authored
Merge pull request webpack#4860 from restrry/add-chunkLoadTimeout-option
make chunkLoadTimeout option configurable
2 parents f2a6439 + f2264e4 commit 3483802

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lib/JsonpMainTemplatePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class JsonpMainTemplatePlugin {
3030
const chunkFilename = this.outputOptions.chunkFilename;
3131
const chunkMaps = chunk.getChunkMaps();
3232
const crossOriginLoading = this.outputOptions.crossOriginLoading;
33-
const chunkLoadTimeout = this.outputOptions.chunkLoadTimeout || 120000;
33+
const chunkLoadTimeout = this.outputOptions.chunkLoadTimeout;
3434
const scriptSrcPath = this.applyPluginsWaterfall("asset-path", JSON.stringify(chunkFilename), {
3535
hash: `" + ${this.renderCurrentHashCode(hash)} + "`,
3636
hashWithLength: length => `" + ${this.renderCurrentHashCode(hash, length)} + "`,

lib/WebpackOptionsDefaulter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter {
6060
this.set("output.hotUpdateChunkFilename", "[id].[hash].hot-update.js");
6161
this.set("output.hotUpdateMainFilename", "[hash].hot-update.json");
6262
this.set("output.crossOriginLoading", false);
63+
this.set("output.chunkLoadTimeout", 120000);
6364
this.set("output.hashFunction", "md5");
6465
this.set("output.hashDigest", "hex");
6566
this.set("output.hashDigestLength", 20);

schemas/webpackOptionsSchema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,10 @@
270270
"use-credentials"
271271
]
272272
},
273+
"chunkLoadTimeout": {
274+
"description": "Number of milliseconds before chunk request expires",
275+
"type": "number"
276+
},
273277
"devtoolFallbackModuleFilenameTemplate": {
274278
"description": "Similar to `output.devtoolModuleFilenameTemplate`, but used in the case of duplicate module identifiers.",
275279
"anyOf": [

0 commit comments

Comments
 (0)