Skip to content

Commit 0660cdb

Browse files
committed
fix: pruning nodes that are only optional and peer from tree
1 parent ed71acb commit 0660cdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

workspaces/arborist/lib/arborist/build-ideal-tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ This is a one-time fix-up, please be patient...
15281528
// root package.json), at which point they won't be optional so
15291529
// any dependencies still marked as both optional and peer at
15301530
// this point can be pruned as a special kind of extraneous
1531-
if (node.extraneous || (node.peer && node.optional)) {
1531+
if (node.extraneous || (node.peer && node.optional && !node.dev && !node.devOptional)) {
15321532
node.parent = null
15331533
}
15341534
}

0 commit comments

Comments
 (0)