Set default host and port for ng serve in config file

后端 未结 12 2228
庸人自扰
庸人自扰 2020-12-07 07:53

I want to know if i can set a host and a port in a config file so I don\'t have to type

ng serve --host foo.bar --port 80

instead of just

12条回答
  •  旧时难觅i
    2020-12-07 08:47

    You can save these in a file, but you have to to put it in .ember-cli (at the moment, at least); see https://github.com/angular/angular-cli/issues/1156#issuecomment-227412924

    {
    "port": 4201,
    "liveReload": true,
    "host": "dev.domain.org",
    "live-reload-port": 49153
    }
    

    edit: you can now set these in angular-cli.json as of commit https://github.com/angular/angular-cli/commit/da255b0808dcbe2f9da62086baec98dacc4b7ec9, which is in build 1.0.0-beta.30

提交回复
热议问题