Angular cli - how to disable auto reload when ng serve

AngularAngular Cli

Angular Problem Overview


When serving my app with the Angular cli, how do I disable auto-reload?

ng --help mentions the --live-reload option, but I can't make it work.

ng serve --live-reload=false or ng serve --live-reload false do not work

EDIT : it seems to be a bug https://github.com/angular/angular-cli/issues/1755

Angular Solutions


Solution 1 - Angular

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

It used to not work, this PR solved it.

Solution 2 - Angular

serve your application with this command:

ng serve --live-reload=false

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

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

Solution 3 - Angular

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

Just try:

$ ng serve --watch=true|false

Solution 4 - Angular

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionmaxbellecView Question on Stackoverflow
Solution 1 - AngularmaxbellecView Answer on Stackoverflow
Solution 2 - Angulars sharifView Answer on Stackoverflow
Solution 3 - AngularPedro LopezView Answer on Stackoverflow
Solution 4 - AngularzmancView Answer on Stackoverflow