Skip to content

This repository can be used to check if and under what circumstances webpack may produce different hashes. See https://github.com/webpack/webpack/issues/1479

Notifications You must be signed in to change notification settings

jhnns/webpack-hash-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-hash-test

This repository can be used to check if and under what circumstances webpack may produce different hashes. See webpack/webpack#1479

Disclaimer

Hashes may change between different npm installations. This is because npm's installation is non-deterministic. In order to expect the same hashes, you need to ensure that all loaders and plugins stay unchanged. This is because loaders and plugins generate code. If they change the generated code, the hashes must also change.

Findings

1. Hashes DO change if a filename changes

Screenshot of terminal

This is surprising since the final bundle does not contain any information about filenames (no output.filename). (If you enabled output.filename, this is another cause for changing hashes).

2. Hashes DO NOT change if the path outside webpack's context change

Screenshot of terminal

3. Hashes are different on a different OS

Screenshot of terminal

As you can see, the hash on the Windows machine is different than the hash on MacOS. This is a logical consequence of 1) since Windows uses backslashes as path separator. It's probably also due to the fact that Windows uses CRLF for new lines.

About

This repository can be used to check if and under what circumstances webpack may produce different hashes. See https://github.com/webpack/webpack/issues/1479

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published