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
{
@@ -365,6 +366,17 @@ class MiniCssExtractPlugin {
365
366
] ) ,
366
367
'};' ,
367
368
'linkTag.href = fullhref;' ,
369
+ crossOriginLoading
370
+ ? Template . asString ( [
371
+ `if (linkTag.href.indexOf(window.location.origin + '/') !== 0) {` ,
372
+ Template . indent (
373
+ `linkTag.crossOrigin = ${ JSON . stringify (
374
+ crossOriginLoading
375
+ ) } ;`
376
+ ) ,
377
+ '}' ,
378
+ ] )
379
+ : '' ,
368
380
'var head = document.getElementsByTagName("head")[0];' ,
369
381
'head.appendChild(linkTag);' ,
370
382
] ) ,
You can’t perform that action at this time.
0 commit comments