angular-cli server - how to specify default port

前端 未结 8 1008
星月不相逢
星月不相逢 2020-12-04 10:42

Using angular-cli with the ng serve command, how can I specify a default port so I do not need to manually pass the --port flag every time?

8条回答
  •  遥遥无期
    2020-12-04 11:17

    You can now specify the port in the .angular-cli.json under the defaults:

    "defaults": {
      "styleExt": "scss",
      "serve": {
        "port": 8080
      },
      "component": {}
    }
    

    Tested in angular-cli v1.0.6

提交回复
热议问题