Bower flat dependency tree version conflict limits
24K reputation · 28 Apr 2022, 15:15 UTC
Dependency Resolution in Flat Trees
Bower implements a flat dependency structure, ensuring that only a single version of any given package exists within a project. This differs from nested dependency models where multiple versions of a library can coexist in different branches of the tree.
When two top‑level dependencies require different, incompatible versions of the same sub‑dependency, the resolution process must determine which version to prioritize to maintain the flat structure. While the resolve section in bower.json allows for manual overrides, the default behavior during the installation phase creates uncertainty regarding automatic version selection when no manual override is provided.
- How does Bower prioritize version selection when multiple conflicting requirements exist for a sub‑dependency?
- What are the specific criteria used to determine the winning version before a manual resolution is defined in the configuration?