I recently started working with Ionic and Cordova, as my job requires me to, and I come across an issue that serves as a bottleneck.
Right now, we’re developing essentially two apps that’re based off of just one business model or majority of code. The first app is our main one, but the second one is for a specific customer. The differences are minimal, namely: theme changes (colour and logo) and two views that should be excluded, as they need to skip the entry point.
Preferably, we want to only use one code base and make the second app the ‘exception’ to the rule, by using something similar to view overrides in certain content management systems (such as Orchard CMS).
I would hold the main app in a repository. another repo only for the changes for the special customer.
if you want to build/work with the special app --> add your own process like --> get the latest sources of the customer repo and replace the basic files (like theming and templates).
So you do not need to manage all files in one ionic project and hold duplicated code/files.
You can use gulp to do it. You write two tasks, one for making the package for your main app and another task for the other app.
In your root you have the commons files, before building your app you can execute the gulp task to copy the file of the version needed and in some files just replace the string value (ex : app name).