I'm wondering if I'm thinking about this correctly.
The TLDR is that I have different functions performing yarn install, with different source files, but same files as far as the above command is installed.
To DRY, I created a shared function that does the install step and returns the container for the next relevant task (lint, build, test, etc).
For efficient layer caching, should I:
- Pass the full src to the install func and then filter to only include yarn related files, then call
yarn install - Filter the yarn related files before passing the the install func
- Neither, I'm way off course
I'm trying to avoid having the yarn install step cache-busted when unrelated code changes. I hope that makes sense! 🍻