Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
6f6d5689
Unverified
Commit
6f6d5689
authored
4 years ago
by
Cyril Auburtin
Committed by
GitHub
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Update env.js without requirement for NODE_ENV, fix
#10195
parent
9b08e3c9
github/fork/caub/patch-1
1 merge request
!10196
Update env.js without requirement for NODE_ENV, fix #10195
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/react-scripts/config/env.js
+2
-7
packages/react-scripts/config/env.js
with
2 additions
and
7 deletions
+2
-7
packages/react-scripts/config/env.js
+
2
-
7
View file @
6f6d5689
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets