未验证 提交 033dd5ed 编写于 作者: J Joe Haddad 提交者: GitHub

Re-require all module information for client-side initializers list (#7571)

* Re-require all module information for client-side initializers list
We really should re-work how our loadable code words, because this passes an excessive number of modules to the client.

In the ideal world, we only pass the entry module id of each chunk, but there's no point in investing the time until we switch to webpack 5 which completely revamps the chunk graph API.

* Get a unique set of ids
上级 5f269d7c
......@@ -473,7 +473,9 @@ export async function renderToHTML(
const dynamicImports = [
...getDynamicImportBundles(reactLoadableManifest, reactLoadableModules),
]
const dynamicImportsIds: any = dynamicImports.map(bundle => bundle.id)
const dynamicImportsIds: any = [
...new Set(dynamicImports.map(bundle => bundle.id)),
]
const amphtml = isAmp(ampMode)
const hasAmp = !amphtml && ampMode.enabled
// update renderOpts so export knows it's AMP
......
......@@ -61,11 +61,6 @@ function buildManifest(
manifest[request] = []
}
// Avoid duplicate files
if (manifest[request].some(item => item.file === file)) {
continue
}
manifest[request].push({
id,
name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册