Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune devDependencies for Yarn 2 #990

Merged
merged 2 commits into from
Mar 23, 2022

Conversation

colincasey
Copy link
Contributor

With Yarn 2 there is currently no built in support for pruning devDependencies. Instead of removing the cache directory entirely and forcing a new install for just the production dependencies, this PR extracts the devDependencies from each package.json found in the application and calls yarn remove to prune them.

Fixes #918, GUS-W-9502576

With Yarn 2 there is currently no built in support for pruning `devDependencies`.  Instead of removing the cache directory entirely and forcing a new install of just the production dependencies, this PR extracts the `devDependencies` from each `package.json` found in the application and calls `yarn remove` to prune them.
@colincasey colincasey requested a review from a team as a code owner March 15, 2022 17:42
@colincasey colincasey merged commit 8d0502a into main Mar 23, 2022
@colincasey colincasey deleted the fix/918_yarn_dev_dependency_pruning branch March 23, 2022 18:41
colincasey added a commit that referenced this pull request Mar 28, 2022
Noticed this was causing CI failures after merging #990.  This should get the failing tests sorted.
colincasey added a commit that referenced this pull request Mar 28, 2022
Noticed this was causing CI failures after merging #990.  This should get the failing tests sorted.
colincasey added a commit that referenced this pull request Mar 30, 2022
There is an issue with the changes to prune the yarn 2 cache that, in certain situations, would cause all devDependencies to be reinstalled during the prune stage which is the opposite result of the intended fix.  This can cause slug sizes to increase for customers so this PR restores the previous cache clearing behavior.
colincasey added a commit that referenced this pull request Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Yarn 2: cache is deleted before pruning dev dependencies, making build slow
2 participants