Hi, I have a monorepo which consists of many packages. These packages are react components. A lot of these packages depend on each other. The users of these packages will install multiple of them. So, this means:
if, package A depends on package B and C
package D depends on package B and A
When the user installs packages A and D, then the bundle of A will have B and C in it, the bundle of D will have B and A (A includes B and C). So you can see with this small example the issue.
I thought I could solve this by making B and C peer dependencies in package A, and so on with the other packages. But then the issue is it cant build because A cant find B and C. So I tried to make B and C both peer and dev dependencies, but that didnt reduce the size of the final build either.
I am really stuck, I feel like I am doing something wrong. If somebody could please help me figure out how I should structure this. I can provide more information just ask anything.