File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ WebIntegrityJsonpMainTemplatePlugin.prototype.addSriHashes =
48
48
*/
49
49
WebIntegrityJsonpMainTemplatePlugin . prototype . addAttribute =
50
50
function addAttribute ( mainTemplate , elName , source , chunk ) {
51
- if ( ! mainTemplate . outputOptions . crossOriginLoading ) {
51
+ const outputOptions = this . compilation . outputOptions || mainTemplate . outputOptions ;
52
+ if ( ! outputOptions . crossOriginLoading ) {
52
53
this . sriPlugin . errorOnce (
53
54
this . compilation ,
54
55
'webpack option output.crossOriginLoading not set, code splitting will not work!'
@@ -57,7 +58,7 @@ WebIntegrityJsonpMainTemplatePlugin.prototype.addAttribute =
57
58
return ( Template . asString || mainTemplate . asString ) ( [
58
59
source ,
59
60
elName + '.integrity = __webpack_require__.sriHashes[' + ( chunk ? `'${ chunk . id } '` : 'chunkId' ) + '];' ,
60
- elName + '.crossOrigin = ' + JSON . stringify ( mainTemplate . outputOptions . crossOriginLoading ) + ';' ,
61
+ elName + '.crossOrigin = ' + JSON . stringify ( outputOptions . crossOriginLoading ) + ';' ,
61
62
] ) ;
62
63
} ;
63
64
You can’t perform that action at this time.
0 commit comments