Skip to content

Commit

Permalink
Enable CORS for legacy bundle loading (#18248)
Browse files Browse the repository at this point in the history
  • Loading branch information
steverep authored Oct 16, 2023
1 parent 3b2f6d7 commit d88831b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions build-scripts/webpack.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const createWebpackConfig = ({
isProdBuild && !isStatsBuild ? "[id]-[contenthash].js" : "[name].js",
assetModuleFilename:
isProdBuild && !isStatsBuild ? "[id]-[contenthash][ext]" : "[id][ext]",
crossOriginLoading: "use-credentials",
hashFunction: "xxhash64",
hashDigest: "base64url",
hashDigestLength: 11, // full length of 64 bit base64url
Expand Down
5 changes: 3 additions & 2 deletions src/html/_js_base.html.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<script>
function _ls(src, sync) {
function _ls(src, notCustom) {
var script = document.createElement("script");
if (sync) {
if (notCustom) {
script.async = false;
script.crossOrigin = "use-credentials";
}
script.src = src;
return document.head.appendChild(script);
Expand Down

0 comments on commit d88831b

Please sign in to comment.