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
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.
1. Hashes DO change if a filename changes
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
3. Hashes are different on a different OS
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.