diff --git a/packages/next/src/build/webpack-build.ts b/packages/next/src/build/webpack-build.ts index 3ab65721abc06..8be8da5a03cba 100644 --- a/packages/next/src/build/webpack-build.ts +++ b/packages/next/src/build/webpack-build.ts @@ -49,7 +49,6 @@ export async function webpackBuild( target: string appDir: string | undefined noMangling: boolean - middlewareMatchers: MiddlewareMatcher[] | undefined }, entrypointsParams: CreateEntrypointsParams ): Promise { @@ -77,18 +76,21 @@ export async function webpackBuild( getBaseWebpackConfig(dir, { ...commonWebpackOptions, runWebpackSpan, + middlewareMatchers: entrypoints.middlewareMatchers, compilerType: COMPILER_NAMES.client, entrypoints: entrypoints.client, }), getBaseWebpackConfig(dir, { ...commonWebpackOptions, runWebpackSpan, + middlewareMatchers: entrypoints.middlewareMatchers, compilerType: COMPILER_NAMES.server, entrypoints: entrypoints.server, }), getBaseWebpackConfig(dir, { ...commonWebpackOptions, runWebpackSpan, + middlewareMatchers: entrypoints.middlewareMatchers, compilerType: COMPILER_NAMES.edgeServer, entrypoints: entrypoints.edgeServer, }),