Skip to content

Commit 4a32171

Browse files
ApacheExgaearon
authored andcommitted
Fix read of .env variables (#2242)
1 parent 70a7f28 commit 4a32171

File tree

1 file changed

+3
-0
lines changed
  • packages/react-scripts/config

1 file changed

+3
-0
lines changed

packages/react-scripts/config/env.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
const fs = require('fs');
1414
const paths = require('./paths');
1515

16+
// Make sure that including paths.js after env.js will read .env variables.
17+
delete require.cache[require.resolve('./paths')];
18+
1619
const NODE_ENV = process.env.NODE_ENV;
1720
if (!NODE_ENV) {
1821
throw new Error(

0 commit comments

Comments
 (0)