fix(hoist): ignore the case when deciding which dependency to hoist

This commit is contained in:
Zoltan Kochan
2021-05-03 21:43:22 +03:00
parent c3595cb01c
commit ec097f4edb
2 changed files with 8 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/hoist": patch
---
Ignore the case of the package name when deciding which dependency to hoist.

View File

@@ -163,11 +163,12 @@ async function hoistGraph (
for (const [childAlias, childPath] of Object.entries(depNode.children)) {
const hoist = opts.getAliasHoistType(childAlias)
if (!hoist) continue
const childAliasNormalized = childAlias.toLowerCase()
// if this alias has already been taken, skip it
if (hoistedAliases.has(childAlias)) {
if (hoistedAliases.has(childAliasNormalized)) {
continue
}
hoistedAliases.add(childAlias)
hoistedAliases.add(childAliasNormalized)
if (!hoistedDependencies[childPath]) {
hoistedDependencies[childPath] = {}
}