-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevents externalizing non-hoisted packages (#8739)
- Loading branch information
Showing
1 changed file
with
11 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
arcanis
Author
Contributor
|
||
return callback() | ||
} | ||
|
||
// Default pages have to be transpiled | ||
if ( | ||
!res.match(/next[/\\]dist[/\\]next-server[/\\]/) && | ||
|
@arcanis this check does not handle symlinks paths, you should resolve to the real paths before doing the check
This broke Nextjs use in pnpm #15616