@@ -244,7 +244,7 @@ export async function turbopackBuild(): Promise<{
244244 }
245245
246246 // For deferred entries, we use debugBuildPaths to control which routes are built
247- // First build excludes deferred entries, second build includes only deferred entries
247+ // in two phases around onBeforeDeferredEntries.
248248 const nonDeferredBuildPaths =
249249 hasDeferredEntries && NextBuildContext . appDir
250250 ? getNonDeferredBuildPaths (
@@ -309,14 +309,13 @@ export async function turbopackBuild(): Promise<{
309309 : NextBuildContext . debugBuildPaths
310310 const firstPassDebugBuildPaths = firstPassBuildPaths ?? undefined
311311
312- // In deferred mode, keep the first pass filter on the project and apply the
313- // deferred filter as a per-write override in the second pass.
312+ // In deferred mode, the first-pass filter must be a per-write override so the
313+ // native layer can treat it as a partial write and avoid eager full-app graph
314+ // work before onBeforeDeferredEntries is called.
314315 const projectDebugBuildPaths = hasDeferredEntries
315- ? firstPassDebugBuildPaths
316- : NextBuildContext . debugBuildPaths
317- const firstPassWriteDebugBuildPaths = hasDeferredEntries
318316 ? undefined
319- : firstPassDebugBuildPaths
317+ : NextBuildContext . debugBuildPaths
318+ const firstPassWriteDebugBuildPaths = firstPassDebugBuildPaths
320319
321320 const project = await bindings . turbo . createProject (
322321 {
0 commit comments