Closed sevba closed 5 months ago
If I shut down "npm run watch" and start it again (i.e. trigger a full re-build of my code) then the manifest is properly updated.
u mean u get app.3d89dd.js
back ?
If I shut down "npm run watch" and start it again (i.e. trigger a full re-build of my code) then the manifest is properly updated.
u mean u get
app.3d89dd.js
back ?
Exactly. So the problem only occurs when webpack watch is supposed to update the manifest. And only when you revert changes (i.e. when a file with the same hash was already built before).
I tried to delete the initial file (app.3d89dd.js) between step 4 and 5, to test if perhaps the issue occurs when webpack already finds an existing file (from an earlier build). This didn't fix it. So it appears that somehow webpack watch is still "aware" of earlier hashes.
Perhaps it caches earlier builds of modules and if it detects that there is actually nothing new (i.e. everything is already in its cache), it decides not to update the manifest?
Because this seemed like an issue with webpack caching, I tried to reproduce with mix.webpackConfig({ cache: false });
however that didn't solve it, the problem persists.
can u try with v1.0.8
of the plugin and reply back ?
can u try with
v1.0.8
of the plugin and reply back ?
I just tried with v1.0.8
but the issue remains.
does the hash change as expected with mix.version ()
?
Yes, it works as expected with the regular mix.version()
feature.
The reason why I prefer your plug-in over the mix.version()
feature is because it actually hashes the filename. This supports my blue/green deployment setup. I deploy my assets (including the compiled JS files) to AWS S3. When I deploy, both the old version (blue) and the new version (green) exist in S3, so a rollback is very easy.
@Erutan409 can u help with this?
I'm not sure this is an issue with laravel-mix-versionhash, as it could also be related to webpack watch.
I noticed that the manifest file isn't updating if you revert a change, while running "npm run watch".
Steps to reproduce:
If you check the modified date of /assets/js/app.3d89dd.js you'll see that it was touched. Also in the asset list shown by the "npm run watch" command, I see the file with the hash 3d89dd.
If I shut down "npm run watch" and start it again (i.e. trigger a full re-build of my code) then the manifest is properly updated.