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

hotfix: Remove cache-loader from webpack fonts rule #1641

Merged

Conversation

remydenton
Copy link
Collaborator

Jira

http://vjira2:8080/browse/WWWD-4467

Summary

Restores font files when creating multiple builds at once

Details

Steps to reproduce the problem

  • Check out the bolt-release-build repo
  • Run 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)
  • Observe that there is a builds/v2.13.1/builds/en--dev/fonts directory, but not a builds/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:

it should not be placed before any loader that has side effects like emitFile

I believe that's the case in our config, though I don't understand why it should be avoided.

You don't need cache-loader on file-loader, why you do this?

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

Copy link
Contributor

@sghoweri sghoweri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@sghoweri sghoweri added this to the v2.13.2 milestone Dec 27, 2019
@sghoweri sghoweri merged commit 8a4dfa4 into release/2.x Dec 30, 2019
@sghoweri sghoweri deleted the fix/WWWD-4467-restore-font-files-in-multiple-builds branch December 30, 2019 15:36
@sghoweri
Copy link
Contributor

PR was released with v2.13.2

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.

3 participants