49

What is the difference between npm run watch and npm run watch-poll in Laravel mix?

I cannot see any difference between the output they give.

Advaith
  • 2,490
  • 3
  • 21
  • 36
  • https://webpack.js.org/configuration/watch/ – Chay22 May 23 '17 at 07:01
  • 5
    Future readers should note that this is a question about [Laravel Mix](https://github.com/JeffreyWay/laravel-mix) , which is a wrapper around Webpack that can be used with or without Laravel. – Pida Jan 24 '19 at 10:29

2 Answers2

72

watch will listen for file changes, however, on certain systems this won't always work.

watch-poll periodically checks (polls) for changes e.g. every 1000ms it will manually check to see if any files have changed.

https://laravel.com/docs/5.4/mix#running-mix

https://webpack.js.org/configuration/watch/

sepehr
  • 17,110
  • 7
  • 81
  • 119
Rwd
  • 34,180
  • 6
  • 64
  • 78
17

watch-poll is an alternative to watch in certain enviroments watch might not track changes properly, therefore watch-poll was implemented.

Poll will check the files every x seconds rather than automatically picking up on changes through watching.

You can read up on the docs for a more information about mix.

Ian
  • 3,539
  • 4
  • 27
  • 48