Skip to content

Commit acbbe02

Browse files
committed
chore(site): Simplify paths generation
1 parent 9f69c4c commit acbbe02

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
@@ -11,13 +11,7 @@ const Content = require('./src/_content.json');
1111

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

0 commit comments

Comments
 (0)