File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ class MiniCssExtractPlugin {
272
272
const chunkMap = this . getCssChunkObject ( chunk ) ;
273
273
if ( Object . keys ( chunkMap ) . length > 0 ) {
274
274
const chunkMaps = chunk . getChunkMaps ( ) ;
275
+ const { crossOriginLoading } = mainTemplate . outputOptions ;
275
276
const linkHrefPath = mainTemplate . getAssetPath (
276
277
JSON . stringify ( this . options . chunkFilename ) ,
277
278
{
@@ -363,6 +364,17 @@ class MiniCssExtractPlugin {
363
364
] ) ,
364
365
'};' ,
365
366
'linkTag.href = fullhref;' ,
367
+ crossOriginLoading
368
+ ? Template . asString ( [
369
+ `if (linkTag.href.indexOf(window.location.origin + '/') !== 0) {` ,
370
+ Template . indent (
371
+ `linkTag.crossOrigin = ${ JSON . stringify (
372
+ crossOriginLoading
373
+ ) } ;`
374
+ ) ,
375
+ '}' ,
376
+ ] )
377
+ : '' ,
366
378
'var head = document.getElementsByTagName("head")[0];' ,
367
379
'head.appendChild(linkTag);' ,
368
380
] ) ,
You can’t perform that action at this time.
0 commit comments