Ionic multi-project setup inside an Nx Monorepo
This project was generated using Nx.
We take advantage of Ionic 4.3.0+ multi-app projects.
If you use yarn be sure to set it as default with ionic config set -g npmClient yarn
ng generate @nrwl/angular:application mobile --directory=customer --prefix=cmob --tags=mobile --style=scss --routing --no-interactive
Prepare the ionic.config.json
and angular.json
default projects.
Fill the gaps to enable the global ionic
cli.
ng add @ionic/angular --project customer-mobile
Fix the generated angular.json
config.
ionic integrations enable capacitor
Build some utility npm scripts.
Add platforms with yarn customer:mobile:cap add android
Run a live-reload dev-server with yarn customer:mobile:run android
ng add @ionic/angular
doesn't update the correct project in the angular.json
DO NOT update the Android Graddle version even if Android Studio insists. Capacitor takes care of the working version.
Android Studio complaining about non-Gradle modules next to Android-Gradle modules:
Close the IDE, delete the .idea
directory, delete the all .iml
files, run <app>:mobile:cap open android
again.
https://stackoverflow.com/a/53920901/885259
Enjoy!