Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build output logging order #56335

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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