I am on Windows OS
I have a before_build Cordova hook. Inside the hook I pass arguments like this:
ionic cordova build android --release --configuration=ivd -- -- --ivd
The ivd argument is passed to the context.opts.options.
This works fine.
I want to build my application with packageType=bundle.
I have seen in several posts that the way to do that is this:
ionic cordova build android --release -- -- -- --packageType=bundle
This works fine and my application builds in .aab format
PROBLEM
If I want to combine the two (build application in bundle mode AND pass arguments to cordova hook) it is not working
TRIED
ionic cordova build android --release -- --ivd -- -- --packageType=bundle
ionic cordova build android --release -- --ivd -- -- -- --packageType=bundle
and several other combinations
WHAT WORKS
If I do only cordova like this:
cordova build android --release --ivd -- -- --packageType=bundle
I get the desired output
EDIT
I answered my question but I would love a deep explanation of how the '--
' works when running ionic cordova
and want to combine a cordova hook
This worked on Windows
This worked on Linux