How to pass environment variables to a Cordova build

I have a Cordova plugin that requires to set an environment variable to configure the build process. I tried to set this variable before calling the meteor run ios-device command, but this doesn’t work. Is there another way to hand environment variables over to the Cordova build commands Meteor is calling internally?

Another question I have: Is there a way to influence the order the Cordova plugins are being installed? I am asking because I need to apply a Cordova hook, but the hook of the other plugin always “wins” overwriting my own changes. For instance, it sets up a Swift Bridging header, but I need to include Meteor’s bridging header as well.

export ENVIRONMENT_VARIABLE=1 && meteor run something

Thanks. I tried exactly this, but it didn’t have any effect on the Cordova build scripts.

Depending on when the cordova plugin needs the env var to be available, you may need to do this on add, not on run. I’ve gotten around the same thing by cloning the cordova plugin in question and hardcoding the relevant env vars - it’s not a pretty workaround because meteor+ios doesn’t play particularly nicely with locally installed plugins (you have to manually link the files in xcode)