Commit 9770d192 authored by Maël Nison's avatar Maël Nison Committed by Joe Haddad

Prevents externalizing non-hoisted packages (#8739)

parent 8cc60713
......@@ -336,6 +336,17 @@ export default async function getBaseWebpackConfig(
return callback()
}
let baseRes
try {
baseRes = resolveRequest(request, dir)
} catch (err) {}
// If the package, when required from the root, would be different from
// what the real resolution would use, then we cannot externalize it
if (baseRes !== res) {
return callback()
}
// Default pages have to be transpiled
if (
!res.match(/next[/\\]dist[/\\]next-server[/\\]/) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment