问题
I'll try to describe our specific problem to avoid running into an XY Problem.
We have one Polymer app, that consists of several independent components (maintained by different teams). Each of these components has dependencies on other components, managed by Bower.
Sometimes, different components (say, A and B) have dependencies on the same components (e.g. C). Now when C releases a new version with a breaking change, both A and B have to upgrade to that new version at the same time.
This quickly becomes undesirable once the number of components grows (as it has for us). Thus, we're wondering if there's a way to update each component's dependencies individually.
We're using polymer-build and vulcanize, if that's relevant.
回答1:
Your individual elements can have different dependencies but your app can have only one version of a certain element.
The reason behind this is you can register a certain name/element only once using document.registerElement
(which polymer uses internally) and i don't think there is any way to de-register an element.
In your app you can control the version of elements by adding resolution.
来源:https://stackoverflow.com/questions/42116106/how-to-update-dependencies-of-one-polymer-component-without-updating-those-of-an