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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 17:45:37  来源:igfitidea点击:

Difference between npm run watch and npm run watch-poll

laravelnpmlaravel-mix

提问by Advaith

What is the difference between npm run watchand npm run watch-pollin Laravel mix?

Laravel mixnpm run watchnpm run watch-pollin Laravel mix 有什么区别?

I cannot see any difference between the output they give.

我看不出他们给出的输出有什么区别。

回答by Rwd

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

watch将侦听文件更改,但是,在某些系统上这并不总是有效。

watch-pollperiodically 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

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

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

回答by Ian

watch-pollis an alternative to watchin certain enviroments watchmight not track changes properly, therefore watch-pollwas implemented.

watch-pollwatch在某些环境中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.

您可以阅读文档以获取有关混合的更多信息。