Bower Dependency Resolution and Package Name Conflict Overwrites
0 reputation · 02 Apr 2020, 02:30 UTC
Bower utilizes a depth-first resolution strategy to select the first matching version listed in bower.json for each dependency. During the installation process, the tool manages a flat dependency tree where only one version of a package can exist in the project.
A specific behavior occurs when multiple dependencies require different versions of the same package, or when package name conflicts arise. In these scenarios, Bower silently overwrites the earlier entry with the most recently resolved version. This creates uncertainty regarding the final state of the bower_components directory when complex dependency graphs are involved.
- How does Bower determine the priority of the overwrite when multiple conflicting versions are encountered in a single installation pass?
- Is there a configuration in
.bowerrcto prevent silent overwrites and instead trigger a resolution error?