ionic-team / ionic-team/ionic-cli
CLI ignores the serve port in angular.json
- Linguagem predominante
- TypeScript
- Estrelas
- 2k
- Forks
- 682
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
**Description:**
When serving the application, the command executed as `ionic serve` translates to `ng run app:serve --host=localhost --port=8100` or something similar. The port is enforced in commandline. When the port for `serve` target is specified in angular.json, it is ignored (or overwritten by commandline). The port shouldn't be enforced this way. Perhaps it shouldn't even be applied in commandline, but rely on defaults provided in respective framework's config (or added only as last resort, if no such default is provided).
I *know* the port can be still passed via commandline, but the exact purpose of written and maintained config (for different environments) is so that we don't have to do that (error-prone).
**Steps to Reproduce:**
Configure port in your angular.json:
```
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build",
"port": 7777
}
```
And execute `ionic serve`.
**Output:**
Observe the app still launching on 8100.
**My `ionic info`:**
```
Ionic:
Ionic CLI : 6.11.9 (/opt/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.3.3
@angular-devkit/build-angular : 0.1001.0
@angular-devkit/schematics : 10.1.0
@angular/cli : 10.1.0
@ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : 6.0.0, android 9.0.0, browser, ios 6.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 12 other plugins)
Utility:
cordova-res : 0.15.1
native-run : 1.1.0
System:
Android SDK Tools : 26.1.1 (/Users/rattkin/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v12.18.3 (/opt/local/bin/node)
npm : 6.14.8
OS : macOS Catalina
Xcode : Xcode 12.0 Build version 12A7209
```
**Other Information:**
-
Guia de contribuição
Direção de pesquisa
Start by tracing the `ionic serve` entry point that builds the `ng run app:serve` arguments, then compare that path with the `serve` options in `angular.json`. Done means a configured port such as 7777 is preserved instead of being replaced by 8100; run the relevant CLI tests if present.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- angular, typescript
- Domínio
- cli
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100