diff options
Diffstat (limited to 'node_modules/webpack/lib/JsonpMainTemplatePlugin.js')
-rw-r--r-- | node_modules/webpack/lib/JsonpMainTemplatePlugin.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/node_modules/webpack/lib/JsonpMainTemplatePlugin.js b/node_modules/webpack/lib/JsonpMainTemplatePlugin.js index 9a80e099d..20cecd919 100644 --- a/node_modules/webpack/lib/JsonpMainTemplatePlugin.js +++ b/node_modules/webpack/lib/JsonpMainTemplatePlugin.js @@ -171,6 +171,7 @@ class JsonpMainTemplatePlugin { mainTemplate.plugin("hot-bootstrap", function(source, chunk, hash) {
const hotUpdateChunkFilename = this.outputOptions.hotUpdateChunkFilename;
const hotUpdateMainFilename = this.outputOptions.hotUpdateMainFilename;
+ const crossOriginLoading = this.outputOptions.crossOriginLoading;
const hotUpdateFunction = this.outputOptions.hotUpdateFunction;
const currentHotUpdateChunkFilename = this.applyPluginsWaterfall("asset-path", JSON.stringify(hotUpdateChunkFilename), {
hash: `" + ${this.renderCurrentHashCode(hash)} + "`,
@@ -186,6 +187,7 @@ class JsonpMainTemplatePlugin { const runtimeSource = Template.getFunctionContent(require("./JsonpMainTemplate.runtime.js"))
.replace(/\/\/\$semicolon/g, ";")
.replace(/\$require\$/g, this.requireFn)
+ .replace(/\$crossOriginLoading\$/g, crossOriginLoading ? `script.crossOrigin = ${JSON.stringify(crossOriginLoading)}` : "")
.replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename)
.replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename)
.replace(/\$hash\$/g, JSON.stringify(hash));
|