Currently Netlify does a few things that are bad for Yarn 2 users:
- Caches the
node_modulesdirectory regardless of the configured Yarn
- Uses the deprecated
cache-folderoption, which will throw a
The most annoying consequence of this is that every time one of my Yarn 2 projects is built it downloads 2 copies of the dependencies, every single build (one from Netlify cache, one from Yarn 2). This results in much longer builds as there is now effectively 0 caching of dependencies.
The Netlify build image should be updated to better handle projects that use Yarn 2.