Caching node_modules
If your CI or offline workflow benefits from caching dependencies, you can keep the Yarn cache inside your project and commit it.
Steps
- Disable the global Yarn cache so it writes to
.yarn/cachein your repo:
- Make sure Git does not ignore the cache folder:
That is it. Your project now contains its own dependency cache.