ionic-team / ionic-team/ionic-cli

Unable to serve to disk while using ionic build --engine=cordova

Đang mở
#3,999 5 bình luận 0 reaction 0 người được giao Xem trên GitHub
triage
Ngôn ngữ chính
TypeScript
Star
2k
Fork
682
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Description:**

Ionic 4 Angular project supports serving to disk with on-the-fly compiling of sources for `browser` engine by calling `ionic build --engine=browser -- --watch`. In that case if any change to assets is made than `www` directory is updated.
But there are no such option for `cordova` engine, i.e. if I call `ionic build --engine=cordova --platform=android -- --watch` then `Unknown option: '--watch'` appears.
AFAIK previous Angular project template has this feature (you could use just `ionic serve --no-open` to get the same behavior as for Ionic 4 browser engine).
In other words, Angular 4 project doesn't provide an ability to watching over sources and compile cordova-compatible assets on the fly. Eventually, it breaks [cordova-simulate](https://github.com/microsoft/cordova-simulate) livereload scenarios and, consequently, Cordova Extension for VS Code simulate scenarios with livereload enabled https://github.com/microsoft/vscode-cordova/issues/532#issuecomment-496563067.

In general, if there are any other ways of how to achieve compiling of Ionic 4 `angular` project with cordova integrated and livereload then it would be enough.

**Steps to Reproduce:**
* Create Ionic 4 angular project:
```
ionic start ionic4app tabs --cordova --type=angular --no-link
cd ionic4app
ionic cordova platform add android
```
* Run `ionic build --engine=browser -- --watch`, then change e.g. `src/app/tab1/tab1.page.html` and see that `www` directory is updated
* Run `ionic build --engine=cordova --platform=android -- --watch` and see `Unknown option: '--watch'` error is appeared.

**My `ionic info`:**

```
Ionic:

ionic (Ionic CLI) : 4.12.0 (/home/akvelon/.nvm/versions/node/v12.0.0/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.4.2
@angular-devkit/build-angular : 0.13.9
@angular-devkit/schematics : 7.3.9
@angular/cli : 7.3.9
@ionic/angular-toolkit : 1.5.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 4 other plugins)

System:

Android SDK Tools : 26.1.1 (/work/sdk)
NodeJS : v12.0.0 (/home/akvelon/.nvm/versions/node/v12.0.0/bin/node)
npm : 6.9.0
OS : Linux 4.15
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.