Skip to content

Commit

Permalink
Fix build output logging order
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Oct 3, 2023
1 parent db48052 commit 24a1ce4
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2080,7 +2080,6 @@ export default async function build(

await exportApp(dir, exportOptions, nextBuildSpan)

const postBuildSpinner = createSpinner('Finalizing page optimization')
ssgNotFoundPaths = exportConfig.ssgNotFoundPaths

// remove server bundles that were exported
Expand Down Expand Up @@ -2531,12 +2530,10 @@ export default async function build(
JSON.stringify(pagesManifest, null, 2),
'utf8'
)

if (postBuildSpinner) postBuildSpinner.stopAndPersist()
console.log()
})
}

const postBuildSpinner = createSpinner('Finalizing page optimization')
let buildTracesSpinner = createSpinner(`Collecting build traces`)

// ensure the worker is not left hanging
Expand Down Expand Up @@ -2697,20 +2694,6 @@ export default async function build(
return Promise.reject(err)
})

await nextBuildSpan.traceChild('print-tree-view').traceAsyncFn(() =>
printTreeView(pageKeys, pageInfos, {
distPath: distDir,
buildId: buildId,
pagesDir,
useStaticPages404,
pageExtensions: config.pageExtensions,
appBuildManifest,
buildManifest,
middlewareManifest,
gzipSize: config.experimental.gzipSize,
})
)

if (debugOutput) {
nextBuildSpan
.traceChild('print-custom-routes')
Expand Down Expand Up @@ -2857,6 +2840,23 @@ export default async function build(
buildTracesSpinner = undefined
}

if (postBuildSpinner) postBuildSpinner.stopAndPersist()
console.log()

await nextBuildSpan.traceChild('print-tree-view').traceAsyncFn(() =>
printTreeView(pageKeys, pageInfos, {
distPath: distDir,
buildId: buildId,
pagesDir,
useStaticPages404,
pageExtensions: config.pageExtensions,
appBuildManifest,
buildManifest,
middlewareManifest,
gzipSize: config.experimental.gzipSize,
})
)

await nextBuildSpan
.traceChild('telemetry-flush')
.traceAsyncFn(() => telemetry.flush())
Expand Down

0 comments on commit 24a1ce4

Please sign in to comment.