Judging from this question on Quora it's not really clear whether the yarn.lock should be added to the .npmignore file or whether it's even necessary since it might even be the default behaviour of yarn? (graphql has added it to the .npmignore file - see here)
Would be great to hear a more definitive answer on this (possibly even add it on Quora).
I think you should add it to .npmignore yeah since Yarn doesn't respect any yarn.lock files coming from packages themselves. It only respects the current project's lock file.
@arcanis @bestander do you we should create an FAQ on the website for this and possibly other questions? It worked well for React I think so why not here?
Thanks @BYK. This definitely increases the scaffolding footprint of a library since every repo now also needs a .npmignore file just to add the yarn.lock file. Would be great to have "better defaults" for this.
@schickling I don't really agree with the increased scaffolding part since most packages actually need an .npmignore file to be lean. There are lots of unnecessary files like tests, etc. that are being packaged.
That said, to make sure we are on the same page, you don't _need_ to ignore it. It is just not used so it is better if you don't ship it (to save space). Nothing more.
Most helpful comment
@schickling I don't really agree with the increased scaffolding part since most packages actually need an
.npmignorefile to be lean. There are lots of unnecessary files like tests, etc. that are being packaged.That said, to make sure we are on the same page, you don't _need_ to ignore it. It is just not used so it is better if you don't ship it (to save space). Nothing more.