zetachang / react-native-dotenv

A Babel preset let you import application configs from .env file (zero runtime dependency)
MIT License
915 stars 68 forks source link

Support for multiple environments #28

Open uLan08 opened 7 years ago

uLan08 commented 7 years ago

Closes #19 Reviews and criticisms are gladly welcome. Hope you have the time to check.

zetachang commented 7 years ago

Hi, thanks for working on this.

The bad news is that RN packager will try to overwrite process.env.BABEL_ENV. (see https://github.com/facebook/metro-bundler/blob/d1d59d81e5926acdc745dac40ba9423f87f1f789/packages/metro-bundler/src/transformer.js#L133)

I've always want to file a ticket for RN to claim the need that the packager should allow variant of default dev & product env. (In most use case, staging might be a variant of production env)

uLan08 commented 7 years ago

Ah darn. Let's file a ticket then, so that we could see what they think about it.

antonsivogrivov commented 7 years ago

Any news?

brandonxiang commented 4 years ago

any news

goatandsheep commented 4 years ago

There's a new repo and package babel-plugin-dotenv-import. Please reopen in the new repo