Enable CORS for legacy bundle loading (#18248)

This commit is contained in:
Steve Repsher 2023-10-16 14:40:15 -04:00 committed by GitHub
parent 3b2f6d71f5
commit d88831b719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -194,6 +194,7 @@ const createWebpackConfig = ({
isProdBuild && !isStatsBuild ? "[id]-[contenthash].js" : "[name].js", isProdBuild && !isStatsBuild ? "[id]-[contenthash].js" : "[name].js",
assetModuleFilename: assetModuleFilename:
isProdBuild && !isStatsBuild ? "[id]-[contenthash][ext]" : "[id][ext]", isProdBuild && !isStatsBuild ? "[id]-[contenthash][ext]" : "[id][ext]",
crossOriginLoading: "use-credentials",
hashFunction: "xxhash64", hashFunction: "xxhash64",
hashDigest: "base64url", hashDigest: "base64url",
hashDigestLength: 11, // full length of 64 bit base64url hashDigestLength: 11, // full length of 64 bit base64url

View File

@ -1,8 +1,9 @@
<script> <script>
function _ls(src, sync) { function _ls(src, notCustom) {
var script = document.createElement("script"); var script = document.createElement("script");
if (sync) { if (notCustom) {
script.async = false; script.async = false;
script.crossOrigin = "use-credentials";
} }
script.src = src; script.src = src;
return document.head.appendChild(script); return document.head.appendChild(script);