We have a shared Ionic app for iOS, Android and PWA. I’m looking for a way to exclude the
<script src="cordova.js"></script> from
index.html when running as PWA.
The PWA still loads in Chrome with a console error but it doesn’t load at all in Firefox because of the missing script file.
The suggestion is to just comment out
cordova.js but I don’t think that’s a great solution, in case you forget to re-include it later for the native apps.
<!-- cordova.js required for cordova apps --> <!--<script src="cordova.js"></script>-->
Would it be possible to write a empty ‘cordova.js’ into
www directory when running as a PWA? Or is a better approach to have two
index.html and use
webpack.config.js to choose depending on PWA vs native app?