ionic-team / ionic-team/ionic-cli

bug: `ionic capacitor run` options conflicts with angular configurations

未關閉
#4,593 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
triage
主要語言
TypeScript
星號
2k
分支
682
PR 合併指標
30 天內沒有已合併 PR

描述

## Bug Report

### Capacitor Version

```
Latest Dependencies:

@capacitor/cli: 2.4.2
@capacitor/core: 2.4.2
@capacitor/android: 2.4.2
@capacitor/electron: 2.4.2
@capacitor/ios: 2.4.2

Installed Dependencies:

@capacitor/cli 2.4.2
@capacitor/android 2.4.2
@capacitor/core 2.4.2
@capacitor/ios 2.4.2
@capacitor/electron not installed

[success] Android looking great! 👌
[success] iOS looking great! 👌
```

### Platform(s)

- [x] iOS
- [x] Android

### Current Behavior

Let's assume the following configuration in `angular.json` :
```json
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "app:build",
"disableHostCheck": true,
"host": "0.0.0.0",
"aot": true,
"ssl": true
},
"dev": {
"proxyConfig": "src/environments/dev/proxy.conf.json"
}
}
```
Now, in case of running the following :
1. `ionic capacitor run --configuration=dev --livereload --external --ssl`
=> everything works fine as both are requiring host=0.0.0.0 and ssl

2. `ionic capacitor run --configuration=dev --livereload --external`
=> the angular local web server will start on `https` (due to the config in angular.json)
=> ionic will think it is on `http` (as the ssl parameter was omitted) and failed to load the web app

3. `ionic capacitor run --configuration=dev --livereload`
=> ionic will pass on `--host=localhost` and override the setting in `angular.json`

### Expected Behavior

If a configuration is passed to `ionic capacitor run` and options like `host` or `ssl` are specified in this configuration, then these options shouldn't be overrided.

### Other Technical Details

`npm --version` output: 6.14.8

`node --version` output: v14.10.1

貢獻指南

開啟貢獻指南

研究方向

Trace the `ionic capacitor run` command and its handling of Angular configuration from the reported `angular.json` examples. Reproduce the three commands with `--configuration=dev`, then verify that configured `host` and `ssl` values are not overridden and that the app loads with the expected protocol and host.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
angular, typescript
領域
cli
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。