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( ...@@ -2396,13 +2396,15 @@ function generateClientSsgManifest(
locales, locales,
}: { buildId: string; distDir: string; locales: string[] } }: { buildId: string; distDir: string; locales: string[] }
) { ) {
const ssgPages = new Set<string>([ const ssgPages = new Set<string>(
...Object.entries(prerenderManifest.routes) [
// Filter out dynamic routes ...Object.entries(prerenderManifest.routes)
.filter(([, { srcRoute }]) => srcRoute == null) // Filter out dynamic routes
.map(([route]) => normalizeLocalePath(route, locales).pathname), .filter(([, { srcRoute }]) => srcRoute == null)
...Object.keys(prerenderManifest.dynamicRoutes), .map(([route]) => normalizeLocalePath(route, locales).pathname),
]) ...Object.keys(prerenderManifest.dynamicRoutes),
].sort()
)
const clientSsgManifestContent = `self.__SSG_MANIFEST=${devalue( const clientSsgManifestContent = `self.__SSG_MANIFEST=${devalue(
ssgPages 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