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

Need variable value to be null/empty string in production env #25

Closed LEEY19 closed 6 years ago

LEEY19 commented 7 years ago

@zetachang Hi David seeking your help, I have a variable which value needs to be set to null in production env. I can't put nothing as it will throw an error when I build the release mode. But if I put VARIABLE=null, it does not quite work like what I expected. Essentially, I need it to be an empty string under production env. How can I do that?

Haroenv commented 7 years ago

did you try VARIABLE=''

jordanmkoncz commented 6 years ago

I'm having the same problem.

@Haroenv I tried your suggestion and it doesn't seem to work, it causes the same error as if VARIABLE did not exist in the .env file at all.

zetachang commented 6 years ago

@jordanmkoncz thanks for pointing this out, it's a bug actually (at this line, given that !empty_string is true, 😅 )

Will fix it soon and publish a new version.

wachunei commented 6 years ago

@zetachang hey, I could help with that and check the presence of the key instead, do you have any progress or should I open a PR?

wachunei commented 6 years ago

This is likely closed by #35

zetachang commented 6 years ago

The fix is released in v0.1.1, thank you guys for helping 💪