角点-如何禁用自动重新加载时,ng 服务

当服务我的应用程序与角点,我如何禁用自动重载?

ng --help提到了 --live-reload选项,但我不能让它工作。

ng serve --live-reload=falseng serve --live-reload false不工作

编辑: 这似乎是一个错误 https://github.com/angular/angular-cli/issues/1755

94225 次浏览

Just do ng serve --live-reload false or ng serve --no-live-reload

It used to not work, this PR solved it.

The solution for this is to upgrade the version of the CLI you are using. The CLI now uses in memory for the build process and is no longer writing to disk. This helps with the antivirus/disk write issue.

I think you only want to disable the rebuild on change option

Just try:

$ ng serve --watch=true|false

serve your application with this command:

ng serve --live-reload=false

Or for modern ng:

ng serve --no-live-reload

if you want to run your application in prod mode, use following command

ng serve --source-map=false --aot --prod --live-reload=false