Ionic2/Cordova build publish app with different features. Example: Free and Paid

I’m developing an application, where it will have a paid (full) version and a free (lite) version.

In another application developed for Android it is possible to manage this easily with flavors (productFlavors), where I can configure the replacement of any part of the application. For example: I can configure an applicationId and flag boolean PAID_VERSION, for each application as follows:

productFlavors {
    free {
        applicationId ''
        buildConfigField "boolean", "PAID_VERSION", "false"
    paid {
        applicationId 'com.mycompany.myapp.paid'
        buildConfigField "boolean", "PAID_VERSION", "true"

And in the code I can check the PAID_VERSION flag of the following way:

boolean b = BuildConfig.PAID_VERSION;

And if I want to change the icon and application name by version I should specify in the packages (applicationId) of each flavor the specific icon replacing the default, for example:

String resource application name:

Free path: /free/res/values/strings.xml

    <string name="app_name">My App - Free</string>

Paid path: /paid/res/values/strings.xml

    <string name="app_name">My App - Paid</string>

Icon Resource:

Free path: /free/res/drawable/icon.png (Imagem Free)

Paid path: /paid/res/drawable/icon.png (Imagem Paid)


How would it be possible to have a similar configuration to that for a Ionic2/Cordova project, which is possible with the same code base generate 2 applications with a few different features, to be distributed in stores simultaneously and independently?

This question was initially created in: StackOverflow