Languages
[Edit]
EN

Angular 7 - disable browser auto reloading

14 points
Created by:
JustMike
3491

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:

Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.