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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。