Skip to content

Commit 6f011d8

Browse files
committed
chore(v2): better chunk naming
1 parent 174ad27 commit 6f011d8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/docusaurus/lib/server/load/routes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,22 @@ async function loadRoutes(pluginsRouteConfigs) {
7272
const componentChunk = genImportChunk(componentPath, 'component');
7373
addRoutesChunkNames(routePath, 'component', componentChunk);
7474

75-
function genRouteChunkNames(value) {
75+
function genRouteChunkNames(value, prefix) {
7676
if (Array.isArray(value)) {
7777
return value.map(genRouteChunkNames);
7878
}
7979

8080
if (_.isObject(value) && !value.__import) {
8181
const newValue = {};
8282
Object.keys(value).forEach(key => {
83-
newValue[key] = genRouteChunkNames(value[key]);
83+
newValue[key] = genRouteChunkNames(value[key], key);
8484
});
8585
return newValue;
8686
}
8787

8888
const importChunk = genImportChunk(
8989
getModulePath(value),
90-
'module',
90+
prefix,
9191
routePath,
9292
);
9393
registry[importChunk.chunkName] = {

0 commit comments

Comments
 (0)