Skip to content

Support custom env file - #3875

Closed
wapgear wants to merge 1 commit into
react:nextfrom
wapgear:patch-2
Closed

wapgear wants to merge 1 commit into
react:nextfrom
wapgear:patch-2

Conversation

@wapgear

@wapgear wapgear commented Jan 20, 2018

Copy link
Copy Markdown

At the current project, we need to have a lot of .env properties based on sub-domain:

master. 
develop. 
a. 
b.

So I think it can be useful for other developers.

Usage example

"start": "CUSTOM_ENV_FILE=.custom.env react-scripts start"

At the current project, we need to have a lot of .env properties based on sub-domain: 
master. 
develop. 
a. 
b.

So I think it can be useful for other developers.
@facebook-github-bot

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot

Copy link
Copy Markdown

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!


// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
var dotenvFiles = [
process.env.CUSTOM_ENV_FILE && `${process.env.CUSTOM_ENV_FILE}`, // support custom env file. Will be useful for CI

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the name of the environment variable to REACT_APP_ENV and add support for a .local env file.

@iansu

iansu commented Feb 12, 2018

Copy link
Copy Markdown
Contributor

Closing this in favour of the env-cmd solution here: #3903 (comment)

@iansu iansu closed this Feb 12, 2018
@lock lock Bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants