fix: address pnpm failing to prune hoisted dev dependencies (#9786)

This commit is contained in:
Sam Chung
2025-07-23 19:52:17 +10:00
committed by GitHub
parent 15ba5ab931
commit 02d58a6c56
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/modules-cleaner": patch
"pnpm": patch
---
`pnpm install --prod` should removing hoisted dev dependencies [#9782](https://github.com/pnpm/pnpm/issues/9782).

View File

@@ -241,7 +241,7 @@ function getPkgsDepPaths (
): Record<DepPath, string> {
const acc: Record<DepPath, string> = {}
for (const [depPath, pkg] of Object.entries(packages)) {
if (skipped.has(depPath)) return acc
if (skipped.has(depPath)) continue
acc[depPath as DepPath] = packageIdFromSnapshot(depPath as DepPath, pkg)
}
return acc