From 4a32171331a17c097cc25c4caab5756130efcfb4 Mon Sep 17 00:00:00 2001 From: Oleg Kuzava Date: Fri, 19 May 2017 16:47:21 +0300 Subject: [PATCH] Fix read of .env variables (#2242) --- packages/react-scripts/config/env.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-scripts/config/env.js b/packages/react-scripts/config/env.js index 4213adf69a2..726db48ab5b 100644 --- a/packages/react-scripts/config/env.js +++ b/packages/react-scripts/config/env.js @@ -13,6 +13,9 @@ const fs = require('fs'); const paths = require('./paths'); +// Make sure that including paths.js after env.js will read .env variables. +delete require.cache[require.resolve('./paths')]; + const NODE_ENV = process.env.NODE_ENV; if (!NODE_ENV) { throw new Error(