Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 229268

Conditionally include JS file

$
0
0

Thanks for your suggestion. Ionic has moved away from gulp and hence I wasn’t too keen to using this method. There were articles using similar method with NPM and ionic.webpack - but those work only for JS and CSS files and not html files.

Finally, I used plain old JS to check location.protocol. If it is not “file:”, I use the script embed, otherwise ignore it. I couldn’t test cordova.js for two reasons 1) it was included later in the file 2) I am using this in PWA and that would have corova.js too.

Lastly, I had to remove branch.js from cordova_plugins.js file in both www and platform_www folder of browser platform to get this working.

Thanks
Nitin


Viewing all articles
Browse latest Browse all 229268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>