mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-30 09:27:04 +02:00
fix(v2): prefetch only existing chunks (#1380)
This commit is contained in:
parent
21793a833d
commit
37897ffc96
1 changed files with 6 additions and 3 deletions
|
@ -35,9 +35,12 @@ const docusaurus = {
|
|||
// Find all webpack chunk names needed
|
||||
const matches = matchRoutes(routes, routePath);
|
||||
const chunkNamesNeeded = matches.reduce((arr, match) => {
|
||||
const chunkNames = Object.values(
|
||||
flat(routesChunkNames[match.route.path]),
|
||||
);
|
||||
const chunk = routesChunkNames[match.route.path];
|
||||
if (!chunk) {
|
||||
return arr;
|
||||
}
|
||||
|
||||
const chunkNames = Object.values(flat(chunk));
|
||||
return arr.concat(chunkNames);
|
||||
}, []);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue