@@ -467,6 +467,7 @@ export const renderToHTMLOrFlight: AppPageRender = (
467
467
href = { fullHref }
468
468
// @ts -ignore
469
469
precedence = { precedence }
470
+ crossOrigin = { renderOpts . crossOrigin }
470
471
key = { index }
471
472
/>
472
473
)
@@ -511,7 +512,7 @@ export const renderToHTMLOrFlight: AppPageRender = (
511
512
const ext = / \. ( w o f f | w o f f 2 | e o t | t t f | o t f ) $ / . exec ( fontFilename ) ! [ 1 ]
512
513
const type = `font/${ ext } `
513
514
const href = `${ assetPrefix } /_next/${ fontFilename } `
514
- ComponentMod . preloadFont ( href , type )
515
+ ComponentMod . preloadFont ( href , type , renderOpts . crossOrigin )
515
516
}
516
517
} else {
517
518
try {
@@ -546,14 +547,15 @@ export const renderToHTMLOrFlight: AppPageRender = (
546
547
const precedence =
547
548
process . env . NODE_ENV === 'development' ? 'next_' + href : 'next'
548
549
549
- ComponentMod . preloadStyle ( fullHref )
550
+ ComponentMod . preloadStyle ( fullHref , renderOpts . crossOrigin )
550
551
551
552
return (
552
553
< link
553
554
rel = "stylesheet"
554
555
href = { fullHref }
555
556
// @ts -ignore
556
557
precedence = { precedence }
558
+ crossOrigin = { renderOpts . crossOrigin }
557
559
key = { index }
558
560
/>
559
561
)
@@ -1449,21 +1451,26 @@ export const renderToHTMLOrFlight: AppPageRender = (
1449
1451
tree : LoaderTree
1450
1452
formState : any
1451
1453
} ) => {
1452
- const polyfills = buildManifest . polyfillFiles
1453
- . filter (
1454
- ( polyfill ) =>
1455
- polyfill . endsWith ( '.js' ) && ! polyfill . endsWith ( '.module.js' )
1456
- )
1457
- . map ( ( polyfill ) => ( {
1458
- src : `${ assetPrefix } /_next/${ polyfill } ${ getAssetQueryString (
1459
- false
1460
- ) } `,
1461
- integrity : subresourceIntegrityManifest ?. [ polyfill ] ,
1462
- } ) )
1454
+ const polyfills : JSX . IntrinsicElements [ 'script' ] [ ] =
1455
+ buildManifest . polyfillFiles
1456
+ . filter (
1457
+ ( polyfill ) =>
1458
+ polyfill . endsWith ( '.js' ) && ! polyfill . endsWith ( '.module.js' )
1459
+ )
1460
+ . map ( ( polyfill ) => ( {
1461
+ src : `${ assetPrefix } /_next/${ polyfill } ${ getAssetQueryString (
1462
+ false
1463
+ ) } `,
1464
+ integrity : subresourceIntegrityManifest ?. [ polyfill ] ,
1465
+ crossOrigin : renderOpts . crossOrigin ,
1466
+ noModule : true ,
1467
+ nonce,
1468
+ } ) )
1463
1469
1464
1470
const [ preinitScripts , bootstrapScript ] = getRequiredScripts (
1465
1471
buildManifest ,
1466
1472
assetPrefix ,
1473
+ renderOpts . crossOrigin ,
1467
1474
subresourceIntegrityManifest ,
1468
1475
getAssetQueryString ( true ) ,
1469
1476
nonce
@@ -1533,15 +1540,7 @@ export const renderToHTMLOrFlight: AppPageRender = (
1533
1540
{ polyfillsFlushed
1534
1541
? null
1535
1542
: polyfills ?. map ( ( polyfill ) => {
1536
- return (
1537
- < script
1538
- key = { polyfill . src }
1539
- src = { polyfill . src }
1540
- integrity = { polyfill . integrity }
1541
- noModule = { true }
1542
- nonce = { nonce }
1543
- />
1544
- )
1543
+ return < script key = { polyfill . src } { ...polyfill } />
1545
1544
} ) }
1546
1545
{ renderServerInsertedHTML ( ) }
1547
1546
{ errorMetaTags }
@@ -1651,6 +1650,7 @@ export const renderToHTMLOrFlight: AppPageRender = (
1651
1650
getRequiredScripts (
1652
1651
buildManifest ,
1653
1652
assetPrefix ,
1653
+ renderOpts . crossOrigin ,
1654
1654
subresourceIntegrityManifest ,
1655
1655
getAssetQueryString ( false ) ,
1656
1656
nonce
0 commit comments