Open mikeduminy opened 3 years ago
There is already a babel plugin for such a feature: https://www.npmjs.com/package/babel-plugin-transform-inline-environment-variables
However, there's an error in the documentation. The .babelrc
configuration should look like this:
{
"plugins": ["babel-plugin-transform-inline-environment-variables"]
}
Do you want to request a feature or report a bug? Feature
What is the current behavior? Environment variables set outside of metro server are not available in the initial bundle of the
What is the expected behavior? Webpack allows explicit environment variable pass through to bundle via a plugin. https://webpack.js.org/plugins/environment-plugin/
I'd like this sort of thing to be supported in metro too.