ionic-team / ionic-team/ionic-cli
when livereload-url is specified, the development server is not started.
- 主要語言
- TypeScript
- 星號
- 2k
- 分支
- 682
- PR 合併指標
- 30 天內沒有已合併 PR
描述
**Description:**
with this command "ionic capacitor run android -l --external --host=192.168.7.78 --port=8021" the development server will be started. everything goes well. app will use http://192.168.7.78:8021/ to access the web app.
but with this command "ionic capacitor run android -l --external --host=192.168.7.78 --port=8021 --livereload-url=http://192.168.7.78:8021", the development serve does not start.
why do I want to specify host & port & the url? for whatever reason, my reality is that the android is connected to a "different" network, and there is some mapping, so even the livereload-url=https://x.y.z/(different IP, DNS or not, and even https), it will be mapped to http://192.168.7.78:8021.
**Steps to Reproduce:**
so simple, so need big effort.
**Output:**
so simple, no need
**My `ionic info`:**
**Other Information:**
To fix:
https://github.com/ionic-team/ionic-cli/blob/develop/packages/%40ionic/cli/src/commands/capacitor/base.ts
inside runServe function
let serverUrl = options['livereload-url'] ? String(options['livereload-url']) : undefined;
if (!serverUrl) {
const details = await runner.run(runnerOpts); //*********
serverUrl = `${details.protocol || 'http'}://${details.externalAddress}:${details.port}`;
}
we just have to move the ***** line out of the if statement, then everything is Okay. If I am wrong, please inform me.
If this is the right solution, then I made a pull request 5125: https://github.com/ionic-team/ionic-cli/pull/5125
貢獻指南
研究方向
Start in packages/@ionic/cli/src/commands/capacitor/base.ts and inspect runServe alongside the two command forms in the report. Reproduce the command with --livereload-url and verify that the development server starts while the supplied URL is used; review pull request 5125 before beginning because the issue reports work already underway.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- typescript
- 領域
- cli
- Issue 類型
- 缺陷
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 25/100