laravel-mix: Manifest hash won't change!
- Laravel Mix Version: 0.10.0
- Node Version: v7.7.3
- NPM Version: 4.1.2
- OS: 10.12.4
Description:
manifes.js hash won’t change even app or vendor names had changed. If manifest is in browsers cache it will load the old app and vendor files.
Steps To Reproduce:
npm run production
<script src="/js/manifest.d41d8cd98f00b204e980.js"></script>
<script src="/js/vendor.0644ae2bcbd1e2178134.js"></script>
<script src="/js/app.d3d968be03d7943f18be.js"></script>
<script type="text/javascript" src="/js/home.40299b3f79c3bf7007fc.js"></script>
change something in app js files npm run production
<script src="/js/manifest.d41d8cd98f00b204e980.js"></script>
<script src="/js/vendor.0644ae2bcbd1e2178134.js"></script>
<script src="/js/app.4b2f4c54fb528e83e8f0.js"></script>
<script type="text/javascript" src="/js/home.40299b3f79c3bf7007fc.js"></script>
As you can see, app change from /js/app.d3d968be03d7943f18be.js to /js/app.4b2f4c54fb528e83e8f0.js but manifest is the same: /js/manifest.d41d8cd98f00b204e980.js
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 19 (2 by maintainers)
This is a “bug” in webpack-chunk-hash (forked from webpack-md5-hash which had the same bug), you can find a lot of official webpack example that show a
manifest.d41d8cd98f00b204e980.jsfile.see some related issue: https://github.com/alexindigo/webpack-chunk-hash/issues/7 https://github.com/erm0l0v/webpack-md5-hash/issues/9
I could trash fix it in my
webpack.mix.jsfile by disabling thewebpack-chunk-hashplugin, this rollback to the default webpack versioning which is able to generate a correct hash for the manifest file:This is how we solved this issue in our apps. After every mix recompile, we update mix-manifest.json with random integers at the end of the file.
Excited, I thought it’s a bug of webpack once… Here’s my monkey-patch:
It looks like this is the md5 hash of an empty file:
simple test.js file:
output:
d41d8cd98f00b204e9800998ecf8427e