Reputation: 1333
Here is my current modules hierarchy:
I'm writing the
Module
(which has green background and is inside dotted square).
It has DepA
dependency which has DepB
peer dependency.
My module is kind of a config-helper for the main App
.
Module
does not use DepB
itself.
But it helps to work with DepB
via DepA
.
The App
works with DepB
and has it as a dependency (regular).
So, I was thinking that this DepB
should be a peer dependency in the Module
.
But that does not work.
It leads to unmet peer dependency
problem: DepA
expects to find it "inside" Module
.
Why can't I proxy that peer dependency to the App
which actually uses it?
What are the best practices for that kind of situation?
Update
The question is not relevant.
See my answer.
Upvotes: 2
Views: 280
Reputation: 1333
OMG, that was my fault!
While testing Module
I did require('../')
instead of require('@my/module')
.
By that I was trying to avoid re-installation on every change.
That was the root of all incorrect module resolution issues.
Upvotes: 1