Unverified Commit e4e6df78 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: respect `--profile` CLI param (#84920)

Previously, `next build --profile` wasn't doing anything, it was still using the non-profiling React build.

Specifying it in next.config.js was already working. But we didn't copy over the CLI flag into `config. reactProductionProfiling` for Turbopack.
parent 356081d5
...@@ -220,7 +220,10 @@ export async function workerMain(workerData: { ...@@ -220,7 +220,10 @@ export async function workerMain(workerData: {
NextBuildContext.config = await loadConfig( NextBuildContext.config = await loadConfig(
PHASE_PRODUCTION_BUILD, PHASE_PRODUCTION_BUILD,
NextBuildContext.dir!, NextBuildContext.dir!,
{ debugPrerender: NextBuildContext.debugPrerender } {
debugPrerender: NextBuildContext.debugPrerender,
reactProductionProfiling: NextBuildContext.reactProductionProfiling,
}
) )
// Matches handling in build/index.ts // Matches handling in build/index.ts
......
...@@ -386,7 +386,10 @@ export async function workerMain(workerData: { ...@@ -386,7 +386,10 @@ export async function workerMain(workerData: {
NextBuildContext.config = await loadConfig( NextBuildContext.config = await loadConfig(
PHASE_PRODUCTION_BUILD, PHASE_PRODUCTION_BUILD,
NextBuildContext.dir!, NextBuildContext.dir!,
{ debugPrerender: NextBuildContext.debugPrerender } {
debugPrerender: NextBuildContext.debugPrerender,
reactProductionProfiling: NextBuildContext.reactProductionProfiling,
}
) )
NextBuildContext.nextBuildSpan = trace( NextBuildContext.nextBuildSpan = trace(
`worker-main-${workerData.compilerName}` `worker-main-${workerData.compilerName}`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment