Unverified Commit 1c8b09d7 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Make `<Head>` children render first, then next/head children, then script preloads/styles (#5852)

parent 93424b64
...@@ -120,6 +120,7 @@ export class Head extends Component { ...@@ -120,6 +120,7 @@ export class Head extends Component {
} }
return <head {...this.props}> return <head {...this.props}>
{children}
{head} {head}
{page !== '/_error' && <link rel='preload' href={`${assetPrefix}/_next/static/${buildId}/pages${pagePathname}`} as='script' nonce={this.props.nonce} crossOrigin={this.props.crossOrigin} />} {page !== '/_error' && <link rel='preload' href={`${assetPrefix}/_next/static/${buildId}/pages${pagePathname}`} as='script' nonce={this.props.nonce} crossOrigin={this.props.crossOrigin} />}
<link rel='preload' href={`${assetPrefix}/_next/static/${buildId}/pages/_app.js`} as='script' nonce={this.props.nonce} crossOrigin={this.props.crossOrigin} /> <link rel='preload' href={`${assetPrefix}/_next/static/${buildId}/pages/_app.js`} as='script' nonce={this.props.nonce} crossOrigin={this.props.crossOrigin} />
...@@ -128,7 +129,6 @@ export class Head extends Component { ...@@ -128,7 +129,6 @@ export class Head extends Component {
{this.getPreloadMainLinks()} {this.getPreloadMainLinks()}
{this.getCssLinks()} {this.getCssLinks()}
{styles || null} {styles || null}
{children}
</head> </head>
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment