Skip to content

Commit 46ef854

Browse files
committed
Only await Webpack Runtime update when Webpack is used
Just saves a microtask cycle
1 parent 3e2275a commit 46ef854

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/next/src/client/components/router-reducer/fetch-server-response.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ export async function fetchServerResponse(
160160
// In prod, every page will have the same Webpack runtime.
161161
// In dev, the Webpack runtime is minimal for each page.
162162
// We need to ensure the Webpack runtime is updated before executing client-side JS of the new page.
163-
if (process.env.NODE_ENV !== 'production' && isNavigation) {
163+
if (
164+
process.env.NODE_ENV !== 'production' &&
165+
isNavigation &&
166+
!process.env.TURBOPACK
167+
) {
164168
await waitForWebpackRuntimeHotUpdate()
165169
}
166170

0 commit comments

Comments
 (0)