I have problems with the HMR not working correctly when I modify a JS file in my project (using Sage 10, and running via WSL).
The changes seems to be correctly detected and the new code appears to be compiled as well, but nothing changes on my page : I have to reload the page manually myself to see the changes.
(For CSS and Blade files, everything works fine)
I tried using the poll: true for the watchOptions and also tried other solutions after doing some research but nothing seems to work.
That’s why I simply want to disable the HMR functionality and force a full page reload on JS file changes.
How can I do that using Bud ? Is there a hook or an event that I can call to detect js modifications and force the reload myself after compilation ?
I’d like to do this too, did you find any solution?
Edit: for anyone with the same issue, I’m not sure if this is the “proper” way to do this but I just added ‘resources/scripts/**/*’ to the watch function on line 28 of bud.config.js.
@Ekeler that seems like a good solution. When one of those files changes it requests the client middleware to trigger a reload, which is exactly what you’re looking to do: