Skip to content

Conversation

@weaverryan
Copy link
Member

Since Webpack 4.3.0, a [contenthash] has existed, which is the recommended way of versioning your filenames. Previously, we used a special plugin that gave us a chunkhash, which worked around issues with hash changing unnecessarily. However, chunkhash actually created a bug - in #461, some chunk id's change unnecessarily. That's bad for caching, but the real problem was that [chunkhash] did not change, and so the filenames did not change. The filenames DO change with [contenthash].

Copy link
Collaborator

@Lyrkan Lyrkan left a comment

Choose a reason for hiding this comment

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

👍 for that change but there are several other places where we mention chunkhash that should probably be modified as well (mostly comments and tests).

Also, we recommended using it in configureFilenames() for the JS key:

* js: '[name].[chunkhash].js',

Wouldn't it be a good idea to add a warning if we detect [chunkhash] to inform users that it would be better to use [contenthash]?

@weaverryan
Copy link
Member Author

Good catch! I do need to change those!

Wouldn't it be a good idea to add a warning if we detect [chunkhash] to inform users that it would be better to use [contenthash]?

Good idea... which means that, for now, we'll need to continue adding the plugin that makes this possible.

@weaverryan
Copy link
Member Author

Test failure is due to a change to the hash calculation in Webpack 4.22.0. I'm going to ignore, so we can release these bug fixes as a patch release. Then, we can bump the minimum Webpack version from ^4.20.0 to ^4.22.0 in another PR for a minor release.

@weaverryan weaverryan deleted the use-content-hash branch August 9, 2019 02:04
weaverryan added a commit that referenced this pull request Aug 9, 2019
This PR was merged into the master branch.

Discussion
----------

Remove webpack-chunk-hash plugin

This PR removes the `webpack-chunk-hash` plugin since:

* using `[chunkhash]` was deprecated a while ago (in #463)
* it seems to be causing issues even when `[chunkhash]` is not used at all (fixes #605)

Commits
-------

b998ad2 Remove webpack-chunk-hash plugin
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.

2 participants