How to deploy a different version of index.html for PWA and native Apps

Hi, our PWA lives here: https://m.quemesa.com and we also have native apps with the same codebase.

However, we are not targeting the Cordova Browser platform (because it does not seem to be officially supported and I can’t see what benefit it adds) so we have to add slightly different code for our PWA compared to our native app builds. For example, In the PWA, we use the pure Google Analytics solution which requires 2 lines of javascript in the index.html.

For our native builds, we use the Cordova GA plugin, so this is not required. In the PWA we don’t need to link to Cordova.js and Vendor.js for exmaple (they get a 404 error). In the native apps we do.

Currently I am manually editing (yuck) the output folder before uploading to Azure for the PWA.

Is there some way to edit the Ionic Build Process so that I can either have 2 versions of the Index and it grabs the one it wants for the output folder depending on the build type OR it can modify the html file at build time?

1 Like

Same question here. Any solution for this @rodneyjoyce?

Thanks in advance