Merge pull request #8113 from styfle/patch-1

Refactor usage of $crossOriginLoading$
This commit is contained in:
Tobias Koppers 2018-10-02 14:15:10 +02:00 committed by GitHub
commit 9b97f3aeb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -16,7 +16,7 @@ module.exports = function() {
var script = document.createElement("script");
script.charset = "utf-8";
script.src = $require$.p + $hotChunkFilename$;
$crossOriginLoading$;
if ($crossOriginLoading$) script.crossOrigin = $crossOriginLoading$;
head.appendChild(script);
}

View File

@ -562,9 +562,7 @@ class JsonpMainTemplatePlugin {
.replace(/\$require\$/g, mainTemplate.requireFn)
.replace(
/\$crossOriginLoading\$/g,
crossOriginLoading
? `script.crossOrigin = ${JSON.stringify(crossOriginLoading)}`
: ""
crossOriginLoading ? JSON.stringify(crossOriginLoading) : "null"
)
.replace(/\$hotMainFilename\$/g, currentHotUpdateMainFilename)
.replace(/\$hotChunkFilename\$/g, currentHotUpdateChunkFilename)