hotfix: Remove cache-loader from webpack fonts rule #1641
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.
Jira
http://vjira2:8080/browse/WWWD-4467
Summary
Restores font files when creating multiple builds at once
Details
Steps to reproduce the problem
npx gulp --bolt-version=v2.13.1 --additional-components="@bolt/components-icon"
(FYI, the additional-components option is a temporary workaround for a separate problem)builds/v2.13.1/builds/en--dev/fonts
directory, but not abuilds/v2.13.1/builds/en/fonts
directory.Note: it's possible this is an intermittent bug and may not always be reproducible the same way
Discussion
The fix in this PR is based on the discussion in webpack-contrib/cache-loader#82
Why it works, I'm less sure. The comments there mention a few things:
I believe that's the case in our config, though I don't understand why it should be avoided.
This brings up a bigger question-- are we even using cache-loader correctly? Specifically, is there any benefit to using cache-loader before something like file-loader or url-loader (as opposed to, for example, babel-loader which has potentially heavy transpiling work to do?)
How to test
Confirm that the change in this PR resolves the bug described in "Steps to reproduce", above