DEV Community

loading...

Discussion on: How to handle peer dependencies when developing modules

Collapse
cristianmorenoruiz profile image
cristian-moreno-ruiz

I think a simpler solution is to add the peerDeps also as devDeps. I don't know if it is the best one, but is way simpler than what you propose here.

Collapse
yvonnickfrin profile image
🦁 Yvonnick FRIN Author

Thank you for sharing! I'll test it and a note about it in the article 👌

Collapse
sevenzark profile image
Dave M

That is one way to do it. One disadvantage, though, is having to manually keep dev and peer in sync. The advantage is not needing another library to install peers. So it's a matter of which trade-off you prefer. Myself, I'm more worried about the error-prone nature of manually duplicating two lists in my package.json so I'm standardizing on just going and using install peers. But I also understand why someone would want to avoid yet another library.