Merging/Combining two Cordova/Ionic applications

I already posted this on StackOverflow: https://stackoverflow.com/q/48832351/4503128

In search of an optimal solution to merge two Cordova applications.

Currently, I can think of two possible ways:

  • Build the 1st application and then merge 2nd application assets in the 1st one.
  • Start with a fresh native project, add Cordova framework manually and then add two separate Cordova activities along with its assets.

Either way, there would be merge conflicts between the files. Ex. config.xml, index.html, assets/**

I need a way to specify what config/index file should a Cordova activity look for.

Something like:

assets/

  • app1
    index.html
  • app2
    index.html

res/xml/

  • app1Config.xml
  • app2Config.xml

AndroidManifest could be merged

What would be the best option/alternative?

And can this be achieved on IOS platform?