diff --git a/packages/react-scripts/config/env.js b/packages/react-scripts/config/env.js
index 2bdc65afa153eaaac8307df1220dbe5e205c2d9e..66ba341b358e081c1b69ffea2f2addd346863ac3 100644
--- a/packages/react-scripts/config/env.js
+++ b/packages/react-scripts/config/env.js
@@ -15,24 +15,25 @@
 var REACT_APP = /^REACT_APP_/i;
 
 function getClientEnvironment(publicUrl) {
-  return Object
+  var processEnv = Object
     .keys(process.env)
     .filter(key => REACT_APP.test(key))
     .reduce((env, key) => {
-      env['process.env.' + key] = JSON.stringify(process.env[key]);
+      env[key] = JSON.stringify(process.env[key]);
       return env;
     }, {
       // Useful for determining whether we’re running in production mode.
       // Most importantly, it switches React into the correct mode.
-      'process.env.NODE_ENV': JSON.stringify(
+      'NODE_ENV': JSON.stringify(
         process.env.NODE_ENV || 'development'
       ),
       // Useful for resolving the correct path to static assets in `public`.
       // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
       // This should only be used as an escape hatch. Normally you would put
       // images into the `src` and `import` them in code to get their paths.
-      'process.env.PUBLIC_URL': JSON.stringify(publicUrl)
+      'PUBLIC_URL': JSON.stringify(publicUrl)
     });
+  return {'process.env': processEnv};
 }
 
 module.exports = getClientEnvironment;
diff --git a/packages/react-scripts/config/webpack.config.prod.js b/packages/react-scripts/config/webpack.config.prod.js
index 4c43cdf51938f2d62bfd375ede2ae3bd51d0de84..2fb3035719eb0d54f4934b58cd1f2c3a22f039c1 100644
--- a/packages/react-scripts/config/webpack.config.prod.js
+++ b/packages/react-scripts/config/webpack.config.prod.js
@@ -49,7 +49,7 @@ var env = getClientEnvironment(publicUrl);
 
 // Assert this just to be safe.
 // Development builds of React are slow and not intended for production.
-if (env['process.env.NODE_ENV'] !== '"production"') {
+if (env['process.env'].NODE_ENV !== '"production"') {
   throw new Error('Production builds must have NODE_ENV=production.');
 }