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

Base the hash on the output rather than the input #13

Open
dobbym opened this issue Jul 21, 2017 · 2 comments
Open

Base the hash on the output rather than the input #13

dobbym opened this issue Jul 21, 2017 · 2 comments

Comments

@dobbym
Copy link

dobbym commented Jul 21, 2017

This will have a problem too. If the inputs stay the same but the modules which package the output change then the hash will stay the same but the output may differ.

For example, i change none of my inputs but Uglify changes, resulting in different output but the same hash.

Why not solve all these problems by basing the hash on the output rather than the inputs?

@constfun
Copy link

Related: webpack/webpack#4659

@hdennen
Copy link

hdennen commented May 4, 2018

I don't think those are problems but rather design choices.

One example: hashed images are referenced in module output. When the image changes the output based hashing would cause the module hash to change which would change the bundle hash.
In this case the end user's cached image would be busted (good) but the entire cached bundle would also be busted (not good).

To your example, technically if the uglified code is different, it's functionality should be identical, meaning the hash should remain the same. If you want protection against a potential uglification bug then it's recommended to change the underlying code at the same time.

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

No branches or pull requests

3 participants