Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

Multi Environments #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gcorreaalves
Copy link

Yeah! I know many people have been asking for multi environments. I don't wanna boring you one more time, but I have done some changes to permit that it works. ;)

I know that Babel uses just development or production options, for this reason I changed to read other variable (ENV_FILE) first.

Examples with Expo:
ENV_FILE=.env.production exp p
ENV_FILE=.env.beta exp p --release-channel beta

At my company we have used this solution, and it works pretty well.

I also wrote some tests. So, you decide if it's worth to be included in the project. Even though it is a Babel Plugin, I think so. :)

I created this repository https://github.com/gcorreaalves/babel-plugin-dotenv just to install the package with the new changes for while, otherwise it doesn't work, but if you accept my PR you can republish it on NPM.

@zetachang
Copy link
Owner

Hi @gcorreaalves , thanks for working on this! This looks like an elegant solution, have you encounter any issue while building directly with Xcode or Gradle (for Android)?

@gcorreaalves
Copy link
Author

Hi @zetachang, I'm glad you have liked it. So far, I haven't tried it using Xcode or Gradle. I gonna do it soon as possible and I let you know if it works.

@bozzmob
Copy link

bozzmob commented Apr 29, 2018

Any update on this? Will this be merged? This is a good to have PR.

@gcorreaalves
Copy link
Author

Hi @bozzmob, unfortunately I haven't tested with Xcode and Gradle yet, but it works pretty well with Expo.

@ashishmusale
Copy link

Any update on this?

@mitaxe
Copy link

mitaxe commented Feb 7, 2019

Any updates?

@gcorreaalves
Copy link
Author

Hi guys, I did some tests but on Xcode or Gradle it does not work.

@peterlin99512
Copy link

When this PR will be merged and release to npm?

@goatandsheep
Copy link

goatandsheep commented May 21, 2020

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

@dapicester
Copy link

@goatandsheep that's great! perhaps you want to update also the README mentioning the multi-environment support.

@goatandsheep
Copy link

@gcorreaalves @dapicester I haven't merged it yet. It needs to work on XCode and Android before we can do that

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants