Angular CLI 6+
In the latest version of Angular, this is set in the angular.json
config file. Example:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"projects": {
"my-project": {
"architect": {
"serve": {
"options": {
"port": 4444
}
}
}
}
}
}
You can also use ng config
to view/edit values:
ng config projects["my-project"].architect["serve"].options {port:4444}
Angular CLI <6
In previous versions, this was set in angular-cli.json
underneath the defaults
element:
{
"defaults": {
"serve": {
"port": 4444,
"host": "10.1.2.3"
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…