Hi everyone, I have a question around managing dependencies between
libs. Is it possible to have dependencies scoped to a library? or is that an an anti-pattern in
For e.g. if I have a
libs/bar and in
libs/foo want to use
libs/bar wants to use lodash
v4.x.x (which can be installed at root)
workspace has a
package.json , however if i generate a publishable library using a plugin, we do have a
libs/<library-name>/package.json too. If I have to install a dependency that my newly generated
library wants to consume, my understanding is that we install it at root level so all libs and apps have access to it. This is good because you workspace can maintain a single version principle and all apps and libs can update dependencies at once, but can each libs have control over the dependency versions in their own
Please let me know?
It seems like you already agree with the idea of keeping a single version of your dependencies. That’s the route that we’d recommend.
It is technically possible to alias a second version of a dependency in you package.json file, like this:
That will probably cause a lot of headaches though.
Thanks Issac. I am in agreement of the benefits of single version principle. Just curious to know if
Nx has any docs that I can read about that list the benefits/tradeoff of this