In an effort to speed up the build of an app with a gigantic set of dependancies, I've tried running "yarn install" in the project directory, then creating .zip files of every "node_modules" folder located in the project root and any subdirectories. Then, after deleting the repo, re-cloning it, copying each .zip file back into their respective directory and extracting, "yarn install" sees everything as up-to-date and finishes in about a second, but then "yarn build" will fail because it cannot find a module.
I cannot rely on Yarn's own caching in this instance, because eventually this solution will be ported to Azure DevOps where each time a build is performed, it will be starting from scratch with a fresh clone of the repository. My idea is to download each .zip file from blob storage and extract them before running "yarn install" and "yarn build", to avoid each build having to spend ~30 minutes downloading packages. I'm effectively trying to make my own ghetto caching solution.
In my head this methodology should totally work, but I have yet to be able to get this to work. Am I missing something? Or is this just not possible the way I'm imagining it?