Skip to content

Commit

Permalink
print turbopack time
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Sep 25, 2024
1 parent 97d14f6 commit 836222c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1640,11 +1640,13 @@ export default async function build(
let shutdownPromise = Promise.resolve()
if (!isGenerateMode) {
if (turboNextBuild) {
console.time('Turbopack build')
const {
duration: compilerDuration,
shutdownPromise: p,
...rest
} = await turbopackBuild()
console.timeEnd('Turbopack build')
shutdownPromise = p
traceMemoryUsage('Finished build', nextBuildSpan)

Expand All @@ -1669,6 +1671,7 @@ export default async function build(
buildStage: 'compile-server',
})

console.time('webpack build')
const serverBuildPromise = webpackBuild(useBuildWorker, [
'server',
]).then((res) => {
Expand Down Expand Up @@ -1736,6 +1739,7 @@ export default async function build(
durationInSeconds += res.duration
traceMemoryUsage('Finished client compilation', nextBuildSpan)
})
console.timeEnd('webpack build')

Log.event('Compiled successfully')

Expand Down

0 comments on commit 836222c

Please sign in to comment.