问题
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