skip to Main Content

On vscode any angular code changing triggers a page refresh which reset all states from my current route getting it so frustating to develop over. I’d like to change the app without reloading entire page like vite on react

Below is my angular json:

   "architect": {
       ...
      "build": {
        ...
        "serve": {
            "options": {
                  "liveReload": true
                 },

And package.json:

  "scripts": {
    "ng": "ng",
    "start": "ng serve --live-reload",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },

2

Answers


  1. Hot module reload, HMR is a feature that partially landed in v19.

    It includes

    • Style HMR
    • External Template HMR with the flag NG_HMR_TEMPLATES=1

    In v19.1, that feature will be extended to include inline templates & won’t require the flag anymore.

    There is no visibility on HMR for the component itself.

    Login or Signup to reply.
  2. I always do ng serve --live-reload false. See if it works

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search