mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Fixes dynamic chunks preload (#4992)
based on [this](https://spectrum.chat/thread/0d24d6cc-96f9-46f0-aa86-515c1b1caac9?m=MTUzNDc2MjA3MzkyMQ==) conversation
This commit is contained in:
parent
a9a3fc1fca
commit
15e6cb8ddf
|
@ -67,8 +67,8 @@ export class Head extends Component {
|
||||||
getPreloadDynamicChunks () {
|
getPreloadDynamicChunks () {
|
||||||
const { dynamicImports, assetPrefix } = this.context._documentProps
|
const { dynamicImports, assetPrefix } = this.context._documentProps
|
||||||
return dynamicImports.map((bundle) => {
|
return dynamicImports.map((bundle) => {
|
||||||
return <script
|
return <link
|
||||||
async
|
rel='preload'
|
||||||
key={bundle.file}
|
key={bundle.file}
|
||||||
src={`${assetPrefix}/_next/${bundle.file}`}
|
src={`${assetPrefix}/_next/${bundle.file}`}
|
||||||
as='script'
|
as='script'
|
||||||
|
|
Loading…
Reference in a new issue