How do I prevent auto reload page when ng serve for one time?

元气小坏坏 提交于 2020-06-27 15:12:46

问题


Sometimes I make few css sketch updates in Chrome, see that it is exactly the updates I need. Then I add them to css file. And at this step, I have to save the css file. But after saving I lose my sketch updates in Chrome. It's ok if I make all changes in css file correctly. But in case I did some misprint or forget to copy some css style I have to check what did I wrong because I can't check with sketch updates in Chrome.

How do I prevent auto reload page when ng serve for one time?


回答1:


Start your dev server with:

ng serve --live-reload false

Docs here: https://github.com/angular/angular-cli/wiki/serve

If that doesn't work then do:

ng serve --live-reload=false

You could run two dev servers at same time as follows:

ng serve // with live reload on port 4200

ng serve --live-reload=false --port=4300 // without live reload on port 4300

These could run concurrently.




回答2:


ng serve --live-reload

this very useful




回答3:


try this

ng serve --live-reload false


来源:https://stackoverflow.com/questions/52741575/how-do-i-prevent-auto-reload-page-when-ng-serve-for-one-time

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