diff --git a/packages/next/src/build/webpack/plugins/middleware-plugin.ts b/packages/next/src/build/webpack/plugins/middleware-plugin.ts index 2326779ad8d9ae..70c80564b1ed3b 100644 --- a/packages/next/src/build/webpack/plugins/middleware-plugin.ts +++ b/packages/next/src/build/webpack/plugins/middleware-plugin.ts @@ -120,7 +120,7 @@ function getEntryFiles( .map( (file) => 'server/' + - file.replace('.js', '_' + CLIENT_REFERENCE_MANIFEST + '.js') + file.replace(/\.js$/, '_' + CLIENT_REFERENCE_MANIFEST + '.js') ) ) }