Disable babel-loader's cacheCompression #7633
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context: #6846 - I received no feedback on it, so I figure a PR is more actionable.
Changes have been tested running on a live website since I filed the issue. Build times and their memory consumption have both decreased with no further issue arising.
cacheCompression
is an enabled-by-default flag in babel-loader,which gzips the babel-loader cache.
Most projects do not actually benefit from cache compression,
especially in production where builds often happen in a CI environment
where memory is precious and disk space is not.
Furthermore, having it disabled in dev and enabled in prod means caching
won't be shared between dev and prod.
Finally, the disk space savings are not that great. Most React projects
will have a lot of small files (one file per component). babel-loader
caches each file as a unit, so the compression overhead increases when
the project is mainly lots of small files.
For these reasons, we're disabling cache compression.
Closes #6846