ionic-team / ionic-team/ionic-cli
when livereload-url is specified, the development server is not started.
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2k
- Fork
- 681
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
**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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu trong packages/@ionic/cli/src/commands/capacitor/base.ts và kiểm tra runServe cùng với hai dạng lệnh trong báo cáo. Tái hiện lệnh với --livereload-url và xác minh rằng máy chủ phát triển khởi động trong khi URL được cung cấp được sử dụng; xem lại pull request 5125 trước khi bắt đầu vì issue cho biết công việc đã được tiến hành.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 25/100