File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ WebIntegrityJsonpMainTemplatePlugin.prototype.addSriHashes =
4848 */
4949WebIntegrityJsonpMainTemplatePlugin . prototype . addAttribute =
5050 function addAttribute ( mainTemplate , elName , source , chunk ) {
51- if ( ! mainTemplate . outputOptions . crossOriginLoading ) {
51+ const outputOptions = this . compilation . outputOptions || mainTemplate . outputOptions ;
52+ if ( ! outputOptions . crossOriginLoading ) {
5253 this . sriPlugin . errorOnce (
5354 this . compilation ,
5455 'webpack option output.crossOriginLoading not set, code splitting will not work!'
@@ -57,7 +58,7 @@ WebIntegrityJsonpMainTemplatePlugin.prototype.addAttribute =
5758 return ( Template . asString || mainTemplate . asString ) ( [
5859 source ,
5960 elName + '.integrity = __webpack_require__.sriHashes[' + ( chunk ? `'${ chunk . id } '` : 'chunkId' ) + '];' ,
60- elName + '.crossOrigin = ' + JSON . stringify ( mainTemplate . outputOptions . crossOriginLoading ) + ';' ,
61+ elName + '.crossOrigin = ' + JSON . stringify ( outputOptions . crossOriginLoading ) + ';' ,
6162 ] ) ;
6263 } ;
6364
You can’t perform that action at this time.
0 commit comments