laravel-mix
laravel-mix copied to clipboard
Laravel mix not compile changes
- Laravel Mix Version: 6.0.49
- Node Version: 16.14.2
- NPM Version:8.5.0
- OS:windows
Description:
laravel mix compile once then laravel mix see changes BUT not compile anything and hotreload not working i see in terminal is refresh this mean he is changes but not compile files
Steps To Reproduce:
npm run watch npm run watch-poll npm run hot
I am also having this problem on Mac OS X. I recently upgraded node to v18.7.0.
I am having this problem as well. Originally we thought this had to do with the fact that the files we were changing were in node_modules, and we had to remove the default ignore of node_modules in watchOptions under Mix 6. Doing so makes it appear like files are being updated when they're changed, but the files are never actually run through js()/sass() and the resulting output never changes. It does work the first time, and npm run prod works every time.
Did you guys find a solutions for this?
@marcelaerts I found one that I'm not super enthused about, but which does appear to work for the time being. If you disable webpack's cache with code like this one:
mix.webpackConfig({
cache: false,
// ... Continue on with your own code
})
It will compile your own assets as well as any changes you make within node_modules. As expected it ramps the time up, and in our case since we have some pretty hefty dependencies in node_modules (Bootstrap 5, others) it increases the watch recompile from something like 5-10 seconds to closer to 30 seconds, but it's better than having to hit npm run dev
every time we make a change.