ionic-team / ionic-team/ionic-cli
Unable to serve to disk while using ionic build --engine=cordova
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 682
- PR merge metrics
- No merged PRs in 30d
Description
**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
```
Contributor guide
Assessment
This issue has not been assessed yet.