laravel npm run watch 和 npm run watch-poll 的区别
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44127688/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between npm run watch and npm run watch-poll
提问by Advaith
What is the difference between npm run watch
and npm run watch-poll
in Laravel mix?
Laravel mixnpm run watch
和npm run watch-poll
in Laravel mix 有什么区别?
I cannot see any difference between the output they give.
我看不出他们给出的输出有什么区别。
回答by Rwd
watch
will listen for file changes, however, on certain systems this won't always work.
watch
将侦听文件更改,但是,在某些系统上这并不总是有效。
watch-poll
periodically checks (polls) for changes e.g. every 1000ms it will manually check to see if any files have changed.
watch-poll
定期检查(轮询)是否有更改,例如每 1000 毫秒,它将手动检查以查看是否有任何文件已更改。
https://laravel.com/docs/5.4/mix#running-mix
https://laravel.com/docs/5.4/mix#running-mix
回答by Ian
watch-poll
is an alternative to watch
in certain enviroments watch
might not track changes properly, therefore watch-poll
was implemented.
watch-poll
是watch
在某些环境中watch
可能无法正确跟踪更改的替代方法,因此watch-poll
已实施。
Poll will check the files every x seconds rather than automatically picking up on changes through watching.
轮询将每 x 秒检查一次文件,而不是通过观察自动获取更改。
You can read up on the docsfor a more information about mix.
您可以阅读文档以获取有关混合的更多信息。