Skip to content

Commit e3a1fe3

Browse files
BYKarcanis
authored andcommitted
fix(resolver): Only optimize patterns in flat mode (#4613)
**Summary** Fixes #4550. The optimization introduced in #4488 should only apply to flat installations since even if a single pattern can satisfy all resolved versions, it is not guaranteed that it is strict enough for resolving correctly for all patterns under all circumstances. **Test plan** Manual verification.
1 parent e3004ab commit e3a1fe3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/package-resolver.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,11 @@ export default class PackageResolver {
545545
this.resolveToResolution(req);
546546
}
547547

548-
for (const dep of deps) {
549-
const name = normalizePattern(dep.pattern).name;
550-
this.optimizeResolutions(name);
548+
if (isFlat) {
549+
for (const dep of deps) {
550+
const name = normalizePattern(dep.pattern).name;
551+
this.optimizeResolutions(name);
552+
}
551553
}
552554

553555
activity.end();

0 commit comments

Comments
 (0)