Skip to content

Commit

Permalink
bolder time reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Oct 4, 2024
1 parent ebdccec commit 570beb8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/next/src/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1669,13 +1669,20 @@ export default async function build(
let shutdownPromise = Promise.resolve()
if (!isGenerateMode) {
if (turboNextBuild) {
console.time('Turbopack build')
const start = Date.now()
const {
duration: compilerDuration,
shutdownPromise: p,
...rest
} = await turbopackBuild()
console.timeEnd('Turbopack build')
const duration = Date.now() - start
const msg =
duration > 2000
? `Turbopack build: ${Math.round(duration / 10) / 100}s`
: `Turbopack build: ${Math.round(duration)}ms`
console.log(`\x1b[1;91;103m ${' '.repeat(msg.length)} \x1b[0m`)
console.log(`\x1b[1;91;103m ${msg} \x1b[0m`)
console.log(`\x1b[1;91;103m ${' '.repeat(msg.length)} \x1b[0m`)
shutdownPromise = p
traceMemoryUsage('Finished build', nextBuildSpan)

Expand Down

0 comments on commit 570beb8

Please sign in to comment.