Unverified Commit 6f6d5689 authored by Cyril Auburtin's avatar Cyril Auburtin Committed by GitHub
Browse files

Update env.js without requirement for NODE_ENV, fix #10195

1 merge request!10196Update env.js without requirement for NODE_ENV, fix #10195
This commit is part of merge request !10196. Comments created here will be created in the context of that merge request.
Showing with 2 additions and 7 deletions
+2 -7
......@@ -16,20 +16,15 @@ const paths = require('./paths');
delete require.cache[require.resolve('./paths')];
const NODE_ENV = process.env.NODE_ENV;
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
);
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
NODE_ENV && `${paths.dotenv}.${NODE_ENV}.local`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
NODE_ENV !== 'test' && `${paths.dotenv}.local`,
`${paths.dotenv}.${NODE_ENV}`,
NODE_ENV && `${paths.dotenv}.${NODE_ENV}`,
paths.dotenv,
].filter(Boolean);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment