taptapship / wiredep

Wire Bower dependencies to your source code.
MIT License
1.15k stars 142 forks source link

precedence of `overrides` in `bower.json` #185

Closed stevemao closed 9 years ago

stevemao commented 9 years ago

Assume module A is used by module B and in module B's bower.json it has

overrides: {
  "A": {...}
}

module B is used by module C and module C doesn't override module A in its own bower.json

When I use wiredep I'm assuming module A's config should be overridden by module B's bower.json. If module C overrides module A then it should take precedence.

Currently only module C's overrides is honoured :sob:

Thought?

stephenplusplus commented 9 years ago

Overrides are only respected on the project level. So, your own bower.json. Inherited overrides is not something we should support, as it could have unintended side-effects, in addition to being completely confusing! If the set up of a project is so tangled, just writing some script tags seems easier.

Let me know if I'm missing something!

stevemao commented 9 years ago

Well, in module A it doesn't have a main entry. In fact, it's not registered on bower. My module B is a wrapper of module A. I have many modules that depends on B and I don't want to write the same overrides for module A in all these modules.

CWSpear commented 9 years ago

This looks like a duplicate of #183 (and actually like 5 others). While not something we want to integrate as a rule, someone posted a way to combine bower.json in that thread as part of a Gulp script that may help you.

stevemao commented 9 years ago

:sob: I totally understand. Although my logic would be: if I work on module C I might not even know module A exists and module B should override module A's config for anyone who depends on module B. npm does it very well and I think bower is way behind :disappointed:

raygig commented 7 years ago

Why is this issue closed? #183 links to this issue https://github.com/taptapship/wiredep/issues/185 which is also closed.

Is there a solution for inheriting overrides in bower.json?