Skip to content

Commit 1fc1824

Browse files
authored
Turbopack: Optimize addedRoutes and removedRoutes calculation (#83840)
## What? Apply suggestion from this review: #83829 (comment)
1 parent 9c94569 commit 1fc1824

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/next/src/server/dev/hot-reloader-turbopack.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,12 @@ export async function createHotReloaderTurbopack(
619619
const newRoutes = [...entrypoints.routes.keys()]
620620

621621
const addedRoutes = newRoutes.filter(
622-
(route) => !existingRoutes.includes(route)
622+
(route) =>
623+
!currentEntrypoints.app.has(route) &&
624+
!currentEntrypoints.page.has(route)
623625
)
624626
const removedRoutes = existingRoutes.filter(
625-
(route) => !newRoutes.includes(route)
627+
(route) => !entrypoints.routes.has(route)
626628
)
627629

628630
processTopLevelIssues(currentTopLevelIssues, entrypoints)

0 commit comments

Comments
 (0)