Skip to content
This repository has been archived by the owner on Jun 3, 2019. It is now read-only.

.env registered, even with a more specific option available #499

Open
mschipperheyn opened this issue Sep 18, 2017 · 0 comments
Open

.env registered, even with a more specific option available #499

mschipperheyn opened this issue Sep 18, 2017 · 0 comments

Comments

@mschipperheyn
Copy link

React Universally will use the .env file even if there is for example an .env.test file available

config/utils/envVars.js

const envFileResolutionOrder = removeNil([
    // Is there an environment config file at the app root?
    // This always takes preference.
    // e.g. /projects/react-universally/.env
    path.resolve(appRootDir.get(), envFile),
    // Is there an environment config file at the app root for our target
    // environment name?
    // e.g. /projects/react-universally/.env.staging
    ifElse(DEPLOYMENT)(path.resolve(appRootDir.get(), `${envFile}.${DEPLOYMENT}`)),
  ]);

should be

const envFileResolutionOrder = removeNil([
    // Is there an environment config file at the app root for our target
    // environment name?
    // e.g. /projects/react-universally/.env.staging
    ifElse(DEPLOYMENT)(path.resolve(appRootDir.get(), `${envFile}.${DEPLOYMENT}`)),
    // Is there an environment config file at the app root?
    // This always takes preference.
    // e.g. /projects/react-universally/.env
    path.resolve(appRootDir.get(), envFile),
  ]);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant