Skip to content

Commit

Permalink
Calculate isNextExternal unconditional of isLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottsj committed Aug 20, 2020
1 parent 018b3f9 commit fc9aeae
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,17 +623,13 @@ export default async function getBaseWebpackConfig(
return callback()
}

let isNextExternal: boolean = false
if (isLocal) {
// we need to process next-server/lib/router/router so that
// the DefinePlugin can inject process.env values
isNextExternal = /next[/\\]dist[/\\]next-server[/\\](?!lib[/\\]router[/\\]router)/.test(
res
)

if (!isNextExternal) {
return callback()
}
// we need to process next-server/lib/router/router so that
// the DefinePlugin can inject process.env values
const isNextExternal = /next[/\\]dist[/\\]next-server[/\\](?!lib[/\\]router[/\\]router)/.test(
res
)
if (isLocal && !isNextExternal) {
return callback()
}

// `isNextExternal` special cases Next.js' internal requires that
Expand Down

0 comments on commit fc9aeae

Please sign in to comment.