Using Babel to inline environment variables during build time
Isn’t this solution for swapping environment variables during build time (local builds) rather than live development ? The name would certainly suggest that.
Nevertheless - I have downloaded the plugin, set it up according to docs, rebuild the app with eas build --profile development-simulator --platform ios, but still after npx expo start --clear the app launches and the process.env.API_URL is undefined.
Loading environment variables from a file
As far as i know there is no way to keep those files in sync with eas.json, is there?
I found this section in the docs about the issue i am facing. However - even though the title might suggest otherwise - this setup after npx expo start will still result in process.env.API_URL to be undefined.
Is the whole idea of eas.json and app.config.js environment variables only viable for build time? Do i have to use .env or .rcenv or API_URL="http://foo.com" npx expo start to have those variables available during local development ?
Is the whole idea of eas.json and app.config.js environment variables only viable for build time?
eas.json is a configuration file for eas services, when you are developing locally you are not using eas. This is the same situation as in any other ci service, you usually have a separate set of envs fro staging/production and for development.
If you have a lot of envs common to what you build on eas and for local development I recommend puting all those values in your js code e.g.
and just use one env to pick which config should be used. This way you only need to specify one env in eas.json or in shell when running expo start or expo update