Skip to content

Is yarn pnp suitable for libraries too? #6288

Answered by arcanis
abiriadev asked this question in Q&A
Discussion options

You must be logged in to vote

yarn pnp stores dependencies to git history

Not necessarily (starting from 4.0, PnP doesn't imply checking-in the dependencies by default). So there are multiple angles to this question:

Should I use Yarn PnP when working on a library?

To that I'd say yes, as PnP ensures you don't depend on packages without listing them in your dependencies. As a result your library is safer for your users, as there are less chances you'd accidentally publish something broken.

Should I check-in my dependencies when working on a library?

To that I'd say "probably not", although it depends on circumstances and your personal taste - checking in the dependencies has no impact once the package is published (…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abiriadev
Comment options

Answer selected by arcanis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants