What is the function of --poll flag in CLI

无人久伴 提交于 2019-12-20 06:28:43

问题


I was searching a solution for an issue which is in my angular project, ng serve --watch was not detecting changes in some of the files.

And I got a solution which says use --poll=2000

It really worked.

But there are no clear information available about the function of flag poll.


回答1:


In cases where Angular CLI is running in a shared directory on linux VM on a windows host the webpack dev server isn't detecting file changes from the host environment. (ex: Whenever a docker dev environment is running on a windows host.) This is solved by adding poll option to the webpack dev server configuration. By default when no poll interval is set watchpack will use native file system change detection. This change allows for setting the poll interval which will turn on polling.

Ref: https://github.com/angular/angular-cli/pull/1814#issuecomment-241854816



来源:https://stackoverflow.com/questions/51930195/what-is-the-function-of-poll-flag-in-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!