Unverified Commit 1a0346e6 authored by Hoon Oh's avatar Hoon Oh Committed by GitHub

fix: keep _ssgManifest.js output uniform (#37906)

Hello,

This PR sorts paths array before generating `_ssgManifest.js` to keep output of static HTML exports uniform.
Before this change, the output of `_ssgManifest.js` would almost always change, which in result changes the static HTML export artifact's checksum every time.
parent 92915e47
......@@ -2396,13 +2396,15 @@ function generateClientSsgManifest(
locales,
}: { buildId: string; distDir: string; locales: string[] }
) {
const ssgPages = new Set<string>([
...Object.entries(prerenderManifest.routes)
// Filter out dynamic routes
.filter(([, { srcRoute }]) => srcRoute == null)
.map(([route]) => normalizeLocalePath(route, locales).pathname),
...Object.keys(prerenderManifest.dynamicRoutes),
])
const ssgPages = new Set<string>(
[
...Object.entries(prerenderManifest.routes)
// Filter out dynamic routes
.filter(([, { srcRoute }]) => srcRoute == null)
.map(([route]) => normalizeLocalePath(route, locales).pathname),
...Object.keys(prerenderManifest.dynamicRoutes),
].sort()
)
const clientSsgManifestContent = `self.__SSG_MANIFEST=${devalue(
ssgPages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment