Hi all!
Would anyone know how to access compile target environment at runtime within the app.
Use case: I use cordova-plugin-admob-free
plugin to show add. At runtime it takes a configuration flag isTesting
which needs to be true
at dev time but on production
needs to be set to false
. Based on webpack.config.js
this would accurately map to env
variable set to production
vs development
.
Ideally I would love to just test for: const isTesting = process.env.NODE_ENV !== 'production'
but of course node env is not available at runtime on Cordova.
Perhaps there is a way to do something at webpack level and set some global variables there based on node env?
Any pointers how you guys solve such needs?