Skip to content

Commit 726bb2a

Browse files
montogeekskipjack
authored andcommitted
chore(site): Simplify paths generation
1 parent 0bab34d commit 726bb2a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

webpack.prod.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@ const Content = require('./src/_content.json');
1212

1313
const paths = Content.children.reduce((paths, page) => {
1414
if (page.type === 'directory') {
15-
paths = Object.assign(
16-
paths,
17-
page.children.reduce((childPaths, child) => {
18-
childPaths[child.url] = child.title;
19-
return childPaths;
20-
}, {})
21-
);
15+
page.children.forEach(child => (paths[child.url] = child.title));
2216
} else {
2317
paths[page.url] = page.title;
2418
}

0 commit comments

Comments
 (0)