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

Why not use HashedModuleIdsPlugin #6909

Open
kwzm opened this issue Apr 26, 2019 · 2 comments
Open

Why not use HashedModuleIdsPlugin #6909

kwzm opened this issue Apr 26, 2019 · 2 comments

Comments

@kwzm
Copy link

kwzm commented Apr 26, 2019

Is this a bug report?

No

I was curious about how create-react-app implements long cache, how do you control the file hashes to remain the same when adding or removing files, because I didn't see HashedModuleIdsPlugin added to the webpack configuration

@ianschmitz
Copy link
Contributor

That's a good question. Reading their caching guide it seems to be the recommended approach.

It appears setting optimization.moduleIds: "hashed" will enable this plugin for us as well: https://github.com/webpack/webpack/blob/81cf088cd6a0231b94fa2399bd29294eccee1907/lib/WebpackOptionsApply.js#L362-L391.

Some other relevant info about a change to the default in webpack 5: webpack/webpack#8268 and https://github.com/webpack/changelog-v5/blob/master/README.md#deterministic-chunk-and-module-ids

@jiajianrong
Copy link

In webpack 4.3, [contenthash](https://github.com/webpack/webpack/releases/tag/v4.3.0) is introduced which I think it's supposed to replace HashedModuleIdsPlugin.

webpack prior to 4.3, only unstable thunkhash was prodived.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants