1
0
Fork 0
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:
Tim Neutkens 2018-08-05 15:53:34 -07:00 committed by GitHub
parent 05b6891620
commit a41e3c102e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)