So I setup a monorepo and have a child app with the following structure:
Ionic-App
- ionic.config.json
- node_modules
- package.json
- apps
- child-app
- node_modules
- ios
- android
- package.json
- child-app
It seems to me that the correct sequence to install a capacitor package is as follows:
- Go into child and do my install
- Go into root rebuild node_modules (remove then npm i)
- Go back into child and run
npx cap sync- this seems to move the dependency from the child package.json and to the root
- this also seems to update the podfile with the path to root
pod 'CapacitorApp', :path => '../../../../node_modules/@capacitor/app'
If I don't follow these exact steps the package seems to stay in the child package.json and the podfile links to the child:
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
My question is, am I doing this right? I haven't found any docs explaining this process. If someone knows where to find that, can you please link to it?