Skip to content
Prev Previous commit
Next Next commit
Ensure dist/next-server and dist/shared are not bundled
  • Loading branch information
timneutkens committed Jun 30, 2021
commit cfaad3f2e53734ad20680ec7105f4034294e6694
3 changes: 2 additions & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -709,9 +709,10 @@ export default async function getBaseWebpackConfig(
}

if (isLocal) {
// Makes sure dist/shared and dist/next-server are not bundled
// we need to process shared/lib/router/router so that
// the DefinePlugin can inject process.env values
const isNextExternal = /next[/\\]dist[/\\]shared[/\\](?!lib[/\\]router[/\\]router)/.test(
const isNextExternal = /next[/\\]dist[/\\](shared|next-server)[/\\](?!lib[/\\]router[/\\]router)/.test(
res
)

Expand Down