Languages
[Edit]
PT

Angular 7 - desativar o recarregamento automático do navegador

1 points
Created by:
Alyona
1170

Problema:

Como desativar o recarregamento automático no angular 7?

Quero parar de recarregar automaticamente no aplicativo angular 7.

Quando faço pequenas alterações no projeto, toda a página da Web é recarregada.
Há uma forma de desabilitá-lo?

Solução:

1. Encontre package.json
2. Altere a linha:
ANTES:

"start": "ng serve",

DEPOIS:

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

3. Reinicie o servidor

4. E ele funciona


O arquivo package.json fica assim:
ANTES:

{
  "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": {
  ....
  ....
  }
  ....
  ....
}

DEPOIS:

{  
  "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": {
  ....
  ....
  }
  ....
  ....
}

Contexto:
https://github.com/angular/angular-cli/issues/1755
https://github.com/angular/angular-cli/issues/9742

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.
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