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

perf(webpack): prefer using contenthash #6632

Merged
merged 1 commit into from
Oct 29, 2019
Merged

Conversation

danielroe
Copy link
Member

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

[contenthash] is a better way of identifying a file if the contents don't change. See issues: webpack/webpack.js.org#2096 and webpack/webpack#7138.

This should mean that assets (like images or fonts) that are unlikely to change between deploys can be cached more efficiently.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. PR: feat: update docs with contenthash defaults docs#1710
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@clarkdo
Copy link
Member

clarkdo commented Oct 29, 2019

The change looks good.

Filename was changed from contenthash to chunkhash 1 year ago #3789 (comment), sorry that I can't recall all the details, @pi0 do you have any idea ?

@pi0
Copy link
Member

pi0 commented Oct 29, 2019

@clarkdo I'm not sure but i think there was issue with vue-loader and extractCSS. Will double check it. We was using content-hash from 2.0.0 (7f6b7d8) (I think because we was using mini-css-extract plugin and having problems)

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

LGTM. (Also verified for style in SCF components with extractCSS).

⚠️ This change invalidates caches but it worth

@pi0 pi0 changed the title perf: prefer contenthash over other hashes fix(webpack): use contenthash instead of chunkhash Oct 29, 2019
@pi0 pi0 changed the title fix(webpack): use contenthash instead of chunkhash perf(webpack): prefer using contenthash Oct 29, 2019
@pi0 pi0 merged commit 4f0aa74 into nuxt:dev Oct 29, 2019
@danielroe danielroe deleted the perf-use-contenthash branch October 29, 2019 18:06
@pi0 pi0 mentioned this pull request Nov 26, 2019
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants