-
Notifications
You must be signed in to change notification settings - Fork 44
Using script-loader seems to lead to a different [chunkhash]
being generated each time
#56
Comments
It's a bit 'old' but maybe it helps https://medium.com/webpack/predictable-long-term-caching-with-webpack-d3eee1d3fa31, otherwise I'm sry but it is very hard to exactly tell where/what in your application currently causes the |
FWIW we've migrated do webpack 4 and |
Update: from what I've noticed in the recent weeks, the issue actually happens also for some new chunks in our project that are not loaded via |
|
nope, not yet unfortunately |
Hello,
First of all, I know that
[chunkhash]
is not the best idea for long term caching, and it's better to use a plugin that creates content-hash, which we will probably do very soon.Nevertheless I wanted to report the issue, even if only to help some other people who are investigating similar issues.
So, we're using webpack 3.x for now, and we have two external scripts, let's call them
foo
andbar
that are loaded through script-loader0.7.1
like this:(with
foo$: 'html/vendor/foo/Foo'
in webpack resolve config).When we run the build twice after some time, without any code change in
foo
orbar
(for example, a non-code commit), this often* results in thechunkhash
change forfoo
andbar
(the chunks that go throughscript-loader
), and no output change for the other chunks -- and this in turn means that themanifest
chunk has to be regenerated as well.*often = not always, and it's happening a lot on our Linux build machines, but I could not reproduce so far on Windows
Looking at the code, things look very simple and there seems to be no obvious reason for
script-loader
to generate differentchunkhash
each time.@sokra Do you have any ideas? Is this kind of issue more likely to be on the plugin side, or webpack side?
The text was updated successfully, but these errors were encountered: