Skip to content

Loading environment variables #687

Closed

Description

@ayrton

Currently Create React App supports environment variables however it leaves some of it to the user's imagination:

Note: Defining environment variables in this manner is temporary for the life of the shell session. Setting permanent environment variables is outside the scope of these docs.

I went on to find my own solution using node-forman but still thought it was sub-optimal*. Is the CRA-team open to leverage dotenv and integrate this in react-scripts (for development)?

Happy to open a PR but wanted to discuss upfront if 👍 or 👎

* I didn't really like wrapping all scripts in a shell script that loads the env variables

Activity

  1. gaearon commented on Sep 21, 2016

    @gaearon
    Contributor

    A PR sounds good to me, a specific proposal would be easier to discuss.
    Thanks!

  2. ayrton commented on Sep 22, 2016

    @ayrton
    ContributorAuthor

    Opened #695 with a working solution

  3. gaearon commented on Sep 23, 2016

    @gaearon
    Contributor

    Fixed in #695, available in 0.5.0.

  4. added this to the 0.5.0 milestone on Sep 23, 2016
  5. gaearon commented on Sep 23, 2016

    @gaearon
    Contributor

    0.5.0 has been released with this feature.

  6. locked and limited conversation to collaborators on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions