You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I'm trying to achieve:
I would like to use environment variables to control whether some babel plugins will be enabled. Namely - I want to include babel-plugin-transform-remove-console when the env variable DISABLE_LOGGING is set to true. This variable is configured in my .env.dev file.
I'm trying to achieve this by reading the value of the DISABLE_LOGGING env variable in my babel.config.js config, but
in order to access the variable through process.env.DISABLE_LOGGING, I have to first load the react-native-dotenv babel plugin.
Solution:
It would be nice if react-native-dotenv exported the config function similar to the dotenv package which can be used like so require('dotenv').config().
I have been able to achieve this effect using this code, but it's undocumented and feels kind of hacky.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
What I'm trying to achieve:
I would like to use environment variables to control whether some babel plugins will be enabled. Namely - I want to include
babel-plugin-transform-remove-console
when the env variableDISABLE_LOGGING
is set totrue
. This variable is configured in my.env.dev
file.I'm trying to achieve this by reading the value of the
DISABLE_LOGGING
env variable in mybabel.config.js
config, butin order to access the variable through
process.env.DISABLE_LOGGING
, I have to first load thereact-native-dotenv
babel plugin.Solution:
It would be nice if
react-native-dotenv
exported the config function similar to thedotenv
package which can be used like sorequire('dotenv').config()
.I have been able to achieve this effect using this code, but it's undocumented and feels kind of hacky.
Is it possible to extract the configuration function and export it separately?
The text was updated successfully, but these errors were encountered: