Angular cli - how to disable auto reload when ng serve

前端 未结 4 1584
日久生厌
日久生厌 2021-02-01 00:25

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.

相关标签:
4条回答
  • 2021-02-01 00:33

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

    It used to not work, this PR solved it.

    0 讨论(0)
  • 2021-02-01 00:33

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

    Just try:

    $ ng serve --watch=true|false
    
    0 讨论(0)
  • 2021-02-01 00:34

    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.

    0 讨论(0)
  • 2021-02-01 00:44

    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
    
    0 讨论(0)
提交回复
热议问题