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

Multi Environments#34

Open
gcorreaalves wants to merge 1 commit into
zetachang:masterfrom
gcorreaalves:improvements/multi-environments
Open

Multi Environments#34
gcorreaalves wants to merge 1 commit into
zetachang:masterfrom
gcorreaalves:improvements/multi-environments

Conversation

@gcorreaalves

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

@satvikmaker

satvikmaker commented Apr 29, 2018

Copy link
Copy Markdown

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

@gcorreaalves

Copy link
Copy Markdown
Author

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

@ashishmusale

Copy link
Copy Markdown

Any update on this?

@mitaxe

mitaxe commented Feb 7, 2019

Copy link
Copy Markdown

Any updates?

@gcorreaalves

Copy link
Copy Markdown
Author

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

@peterlin99512

Copy link
Copy Markdown

When this PR will be merged and release to npm?

@goatandsheep

goatandsheep commented May 21, 2020

Copy link
Copy Markdown

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

@dapicester

Copy link
Copy Markdown

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

@goatandsheep

Copy link
Copy Markdown

@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