Skip to content

Commit 04cb253

Browse files
sokraskipjack
authored andcommitted
fix(site): fix unnecessarily large bundle/html sizes (#1790)
Remove unneeded `file` property that was causing huge output files to be emitted.
1 parent 232bf00 commit 04cb253

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/components/Site/Site.jsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,17 @@ const Site = ({
4343
.map((section) => ({
4444
title: section.path.title,
4545
url: section.url,
46-
pages: section.pages.map(page => ({
47-
file: page.file,
48-
title: page.file.title,
49-
url: page.url
50-
})).sort(({ file: { attributes: a }}, { file: { attributes: b }}) => {
46+
pages: section.pages.slice().sort(({ file: { attributes: a }}, { file: { attributes: b }}) => {
5147
let group1 = a.group.toLowerCase();
5248
let group2 = b.group.toLowerCase();
5349

5450
if (group1 < group2) return -1;
5551
if (group1 > group2) return 1;
5652
return a.sort - b.sort;
57-
})
53+
}).map(page => ({
54+
title: page.file.title,
55+
url: page.url
56+
}))
5857
}))
5958
} />
6059

0 commit comments

Comments
 (0)