mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Await preloading right before rendering the page (#4896)
This commit is contained in:
parent
05b6891620
commit
a41e3c102e
|
@ -72,8 +72,6 @@ async function doRender (req, res, pathname, query, {
|
|||
require(appPath)
|
||||
])
|
||||
|
||||
await Loadable.preloadAll() // Make sure all dynamic imports are loaded
|
||||
|
||||
Component = Component.default || Component
|
||||
|
||||
if (typeof Component !== 'function') {
|
||||
|
@ -143,6 +141,8 @@ async function doRender (req, res, pathname, query, {
|
|||
return { html, head, errorHtml, buildManifest }
|
||||
}
|
||||
|
||||
await Loadable.preloadAll() // Make sure all dynamic imports are loaded
|
||||
|
||||
const docProps = await loadGetInitialProps(Document, { ...ctx, renderPage })
|
||||
const dynamicImports = getDynamicImportBundles(reactLoadableManifest, reactLoadableModules)
|
||||
|
||||
|
|
Loading…
Reference in a new issue