mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-20 03:32:29 +02:00
chore(v2): better chunk naming
This commit is contained in:
parent
174ad279a6
commit
6f011d8e7a
1 changed files with 3 additions and 3 deletions
|
@ -72,7 +72,7 @@ async function loadRoutes(pluginsRouteConfigs) {
|
|||
const componentChunk = genImportChunk(componentPath, 'component');
|
||||
addRoutesChunkNames(routePath, 'component', componentChunk);
|
||||
|
||||
function genRouteChunkNames(value) {
|
||||
function genRouteChunkNames(value, prefix) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(genRouteChunkNames);
|
||||
}
|
||||
|
@ -80,14 +80,14 @@ async function loadRoutes(pluginsRouteConfigs) {
|
|||
if (_.isObject(value) && !value.__import) {
|
||||
const newValue = {};
|
||||
Object.keys(value).forEach(key => {
|
||||
newValue[key] = genRouteChunkNames(value[key]);
|
||||
newValue[key] = genRouteChunkNames(value[key], key);
|
||||
});
|
||||
return newValue;
|
||||
}
|
||||
|
||||
const importChunk = genImportChunk(
|
||||
getModulePath(value),
|
||||
'module',
|
||||
prefix,
|
||||
routePath,
|
||||
);
|
||||
registry[importChunk.chunkName] = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue