Closed stpch closed 5 years ago
I agree. import * as dotenv from 'react-native-dotenv'
results in an error. It would be really nice if we were able to import all, and then iterate through dotenv
and assign it to process.env
or whatever other global we want to use.
This will not work since assigning to process.env is done at runtime but you cannot control which code will be ran first, unless process.env is purely accessed at a later in time.
First of all nice idea doing env variables with Babel / JS instead of native modules.
It would be great if a single
import 'react-native-dotenv';
populatedprocess.env
so that env variables could be accessed the regularprocess.env.MY_VAR
way. Not sure if this is possible with the Babel approach.