From 8eb0bb675e03ce5856a7f2c93c4d731c7b6a6681 Mon Sep 17 00:00:00 2001 From: Neehar Venugopal Date: Thu, 4 Jan 2018 20:00:50 +0530 Subject: [PATCH] move default script type option to WebpackOptionsDefaulter --- lib/JsonpMainTemplatePlugin.js | 2 +- lib/WebpackOptionsDefaulter.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/JsonpMainTemplatePlugin.js b/lib/JsonpMainTemplatePlugin.js index f8fb0c77f..0ce681cf5 100644 --- a/lib/JsonpMainTemplatePlugin.js +++ b/lib/JsonpMainTemplatePlugin.js @@ -29,7 +29,7 @@ class JsonpMainTemplatePlugin { const chunkMaps = chunk.getChunkMaps(); const crossOriginLoading = this.outputOptions.crossOriginLoading; const chunkLoadTimeout = this.outputOptions.chunkLoadTimeout; - const jsonpScriptType = this.outputOptions.jsonpScriptType || "text/javascript"; + const jsonpScriptType = this.outputOptions.jsonpScriptType; const scriptSrcPath = this.applyPluginsWaterfall("asset-path", JSON.stringify(chunkFilename), { hash: `" + ${this.renderCurrentHashCode(hash)} + "`, hashWithLength: length => `" + ${this.renderCurrentHashCode(hash, length)} + "`, diff --git a/lib/WebpackOptionsDefaulter.js b/lib/WebpackOptionsDefaulter.js index ff0cc8072..068ff10e5 100644 --- a/lib/WebpackOptionsDefaulter.js +++ b/lib/WebpackOptionsDefaulter.js @@ -61,6 +61,7 @@ class WebpackOptionsDefaulter extends OptionsDefaulter { this.set("output.hotUpdateChunkFilename", "[id].[hash].hot-update.js"); this.set("output.hotUpdateMainFilename", "[hash].hot-update.json"); this.set("output.crossOriginLoading", false); + this.set("output.jsonpScriptType", "text/javascript"); this.set("output.chunkLoadTimeout", 120000); this.set("output.hashFunction", "md5"); this.set("output.hashDigest", "hex");