bower.json resolutions for conflicting semver ranges
0 reputation · 04 Mar 2021, 13:50 UTC
Dependency Resolution in Flat Trees
Bower employs a flat dependency structure where only a single version of any given package can exist within the bower_components directory. When multiple dependencies require different, incompatible semantic versioning (semver) ranges for the same sub‑dependency, the installation process triggers a conflict error.
While the resolutions field in bower.json allows for manual overrides to force a specific version, there is uncertainty regarding the priority of these overrides when combined with strict version constraints in the primary dependency list.
- How does Bower prioritize a version specified in the
resolutionsblock if that version falls outside the semver range defined in the maindependenciesobject? - Is it possible to define multiple acceptable resolution versions for different environments within a single configuration file?