'How to set global configuration for angular-cli?

I would like to make my ng serve command default with liveReload = false.

I tried ng config --global serve.options.liveReload false but I got an Invalid Path error.

Also I want to know specifically how to edit the global config, no changing of local project files.



Solution 1:[1]

  1. If you are looking for the global CLI config, I found it here on Windows:

%USERPROFILE%\angular-config.json

Solution 2:[2]

Go to your angular.json file, look for you serve section and change options.

...
"projects": {
  "myorg": {
    ...
    "architect": {
      ...
      "serve": {
        "options": {
          ...
          "liveReload": false,
        }
      }
    }
  }
}

This will make your ng serve run ng serve --liveReload=false.
Check the docs here to find all options.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Casey Plummer
Solution 2 João Ghignatti