Closed alecgibson closed 3 years ago
I don't believe this is best practice. Please cite sources to the contrary.
This sums up what I consider best practice around this: https://dev.to/gajus/stop-using-package-lock-json-or-yarn-lock-3ddi
In short:
package-lock.json
if your repo is a standalone appObviously this is your repo, so obviously do whatever you think is best; I just raised this in case the lockfile had been accidentally committed.
You can see in the commit history it is not an accident. I agree with the top commenter on that blog post who is a maintainer of yarn that one should always commit package-lock.json for the reason he gives. This is also in addition to official NPM docs which that blog posts tries to spin as a source of confusion.
package-lock.json
is not published, so it shouldn't be committed in packages, since running a build with a lockfile will not give a true representation of how a consumer would be installing dependencies.