Unverified Commit 4b06e62d authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Sort next-server NFT json files (#79956)

For more deterministic build outputs (at least with Turbopack)
parent 9ff3f848
...@@ -506,12 +506,19 @@ export async function collectBuildTraces({ ...@@ -506,12 +506,19 @@ export async function collectBuildTraces({
addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles) addToTracedFiles(root, relativeModulePath, minimalServerTracedFiles)
} }
const serverTracedFilesSorted = Array.from(serverTracedFiles)
serverTracedFilesSorted.sort()
const minimalServerTracedFilesSorted = Array.from(
minimalServerTracedFiles
)
minimalServerTracedFilesSorted.sort()
await Promise.all([ await Promise.all([
fs.writeFile( fs.writeFile(
nextServerTraceOutput, nextServerTraceOutput,
JSON.stringify({ JSON.stringify({
version: 1, version: 1,
files: Array.from(serverTracedFiles), files: serverTracedFilesSorted,
} as { } as {
version: number version: number
files: string[] files: string[]
...@@ -521,7 +528,7 @@ export async function collectBuildTraces({ ...@@ -521,7 +528,7 @@ export async function collectBuildTraces({
nextMinimalTraceOutput, nextMinimalTraceOutput,
JSON.stringify({ JSON.stringify({
version: 1, version: 1,
files: Array.from(minimalServerTracedFiles), files: minimalServerTracedFilesSorted,
} as { } as {
version: number version: number
files: string[] files: string[]
......
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