I recently upgraded to Yarn2 and added the following to my .gitignore
.yarn/*
!.yarn/cache
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
I still use nodeLinker: node-modules, however when I push my code, I am pushing the .yarn/cache folder with new files whenever I upgrade packages.
Should this folder be pushed to Git or just in my machine? Please advice.
The reason why .yarn/cache is not ignored is because you have the ! in front of it.
Yarn Berry (Yarn 2/3) stores your node_module's zip files in its cache.
The Cache can be global in your system, and therefore - shared between multiple projects, or local.
I assume in your case, that the cache is local and stored inside-
<project_dir>/.yarn/cache
To change this behavior you can use enableGlobalCache: true in .yarnrc.yml.
Should this folder be pushed to Git or just in my machine?
Well, it's a trade-off.
Pros:
fetch stageCons:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With