Languages
[Edit]
EN

Angular 7 - disable browser auto reloading

14 points
Created by:
chelsea
806

Problem:

How to disable auto reloading in angular 7?

I want to stop auto reloading in angular 7 app.
When I make even small change in project entire web page reloads.
Is there a way to disable it?

Solution:

1. Find package.json

2. Change 1 line:

BEFORE:

"start": "ng serve",

AFTER:

"start": "ng serve --live-reload false",

3. Restart server

4. And it works

 

NOTE: package.json file looks like this:

BEFORE:

{
  "name": "ng-gmaps",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve", <--------- THIS LINE BEFORE
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
  ....
  ....
  }
  ....
  ....
}

AFTER:

{  
  "name": "ng-gmaps",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --live-reload false", <--------- THIS LINE AFTER
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
  ....
  ....
  }
  ....
  ....
}

Context:

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Angular 7

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join