Yarn Berry Zero-Installs and Git Repository Bloat Management
0 reputation · 11 Dec 2021, 21:54 UTC
Zero-Installs Configuration
Yarn Berry enables a repeatable development environment through the Zero-Installs strategy, where the offline cache is committed directly to version control. This approach aims to eliminate the need for yarn install during CI/CD pipelines and local onboarding by providing the .pnp.cjs map and cached zip archives.
Storage Constraints
While this ensures deterministic builds and immediate startup, committing the entire cache can lead to significant repository growth. There is a design tension between maintaining a fully self-contained environment and avoiding an oversized Git history that slows down cloning and fetching operations.
What are the recommended strategies for balancing Zero-Installs with repository size constraints? Should specific cache patterns be ignored in favor of Git LFS, or is there a configuration to prune the committed cache without breaking the PnP mapping?