Im using Laravel and laravel-mix using Vagrant and all of a sudden npm run watch does not work. So I started using watch poll, however it keeps crashing my VM as it is maxing out my CPU
Polling will definitely push your CPU more. Try setting a longer poll interval. Within your package.json file, update your watch-poll script to use a five second interval, like this:
"watch-poll": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll=5000 --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
@JeffreyWay What is the default poll interval?
For the project I'm working on currently the CPU load is 90% or over using watch-poll. Not sure why the CPU load is suddenly so high, been using watch-poll for other projects without hogging the CPU.
Anyway, with an interval of 200ms, CPU usage go's down to ~50%, which is acceptable.
+1 I am having this very same issue
I got tired of my MBPr 2012 having it's fans on all the time. I set the polling to 5000 and this fixed the issue for me. Using the latest laravel for what it's worth.
Most helpful comment
Polling will definitely push your CPU more. Try setting a longer poll interval. Within your
package.jsonfile, update yourwatch-pollscript to use a five second interval, like this: