@@ -836,17 +836,18 @@ export type StaticWorker = typeof import('./worker') & Worker
836836export function createStaticWorker (
837837 config : NextConfigComplete ,
838838 options : {
839+ numberOfWorkers : number
839840 debuggerPortOffset : number
840841 progress ?: {
841842 run : ( ) => void
842843 clear : ( ) => void
843844 }
844845 }
845846) : StaticWorker {
846- const { debuggerPortOffset, progress } = options
847+ const { numberOfWorkers , debuggerPortOffset, progress } = options
847848 return new Worker ( staticWorkerPath , {
848849 logger : Log ,
849- numWorkers : getNumberOfWorkers ( config ) ,
850+ numWorkers : numberOfWorkers ,
850851 onActivity : ( ) => {
851852 progress ?. run ( )
852853 } ,
@@ -1915,8 +1916,11 @@ export default async function build(
19151916 traceMemoryUsage ( 'Finished type checking' , nextBuildSpan )
19161917 }
19171918
1919+ const numberOfWorkers = getNumberOfWorkers ( config )
19181920 const collectingPageDataStart = process . hrtime ( )
1919- const postCompileSpinner = createSpinner ( 'Collecting page data' )
1921+ const postCompileSpinner = createSpinner (
1922+ `Collecting page data using ${ numberOfWorkers } worker${ numberOfWorkers > 1 ? 's' : '' } `
1923+ )
19201924
19211925 const buildManifestPath = path . join ( distDir , BUILD_MANIFEST )
19221926
@@ -1958,7 +1962,10 @@ export default async function build(
19581962
19591963 process . env . NEXT_PHASE = PHASE_PRODUCTION_BUILD
19601964
1961- const worker = createStaticWorker ( config , { debuggerPortOffset : - 1 } )
1965+ const worker = createStaticWorker ( config , {
1966+ numberOfWorkers,
1967+ debuggerPortOffset : - 1 ,
1968+ } )
19621969
19631970 const analysisBegin = process . hrtime ( )
19641971 const staticCheckSpan = nextBuildSpan . traceChild ( 'static-check' )
@@ -2480,7 +2487,7 @@ export default async function build(
24802487 if ( postCompileSpinner ) {
24812488 const collectingPageDataEnd = process . hrtime ( collectingPageDataStart )
24822489 postCompileSpinner . setText (
2483- `Collecting page data in ${ hrtimeDurationToString ( collectingPageDataEnd ) } `
2490+ `Collecting page data using ${ numberOfWorkers } worker ${ numberOfWorkers > 1 ? 's' : '' } in ${ hrtimeDurationToString ( collectingPageDataEnd ) } `
24842491 )
24852492 postCompileSpinner . stopAndPersist ( )
24862493 }
@@ -3063,8 +3070,8 @@ export default async function build(
30633070 debugPrerender,
30643071 pages : combinedPages ,
30653072 outdir,
3066- statusMessage : ' Generating static pages' ,
3067- numWorkers : getNumberOfWorkers ( exportConfig ) ,
3073+ statusMessage : ` Generating static pages using ${ numberOfWorkers } worker ${ numberOfWorkers > 1 ? 's' : '' } ` ,
3074+ numWorkers : numberOfWorkers ,
30683075 appDirOnly,
30693076 } ,
30703077 nextBuildSpan
0 commit comments