diff --git a/.changeset/upset-ends-yell.md b/.changeset/upset-ends-yell.md new file mode 100644 index 0000000000..409b8a281b --- /dev/null +++ b/.changeset/upset-ends-yell.md @@ -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). diff --git a/pkg-manager/modules-cleaner/src/prune.ts b/pkg-manager/modules-cleaner/src/prune.ts index a00fe71d99..73ee876d83 100644 --- a/pkg-manager/modules-cleaner/src/prune.ts +++ b/pkg-manager/modules-cleaner/src/prune.ts @@ -241,7 +241,7 @@ function getPkgsDepPaths ( ): Record { const acc: Record = {} 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