From 096f3c671838057b8e6aa292d5a9e11b454987b9 Mon Sep 17 00:00:00 2001 From: Archie Lee Date: Fri, 10 Feb 2017 10:26:41 +0800 Subject: [PATCH] Changed variables naming to `raw` and `stringified` --- packages/react-scripts/config/env.js | 12 ++++++------ packages/react-scripts/config/webpack.config.dev.js | 4 ++-- packages/react-scripts/config/webpack.config.prod.js | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/react-scripts/config/env.js b/packages/react-scripts/config/env.js index b9dc2da7b5c..82400688c94 100644 --- a/packages/react-scripts/config/env.js +++ b/packages/react-scripts/config/env.js @@ -15,7 +15,7 @@ var REACT_APP = /^REACT_APP_/i; function getClientEnvironment(publicUrl) { - var vars = Object + var raw = Object .keys(process.env) .filter(key => REACT_APP.test(key)) .reduce((env, key) => { @@ -32,18 +32,18 @@ function getClientEnvironment(publicUrl) { 'PUBLIC_URL': publicUrl }); // Stringify all values so we can feed into Webpack DefinePlugin - var string = { + var stringified = { 'process.env': Object - .keys(vars) + .keys(raw) .reduce((env, key) => { - env[key] = JSON.stringify(vars[key]); + env[key] = JSON.stringify(raw[key]); return env; }, {}), }; return { - vars: vars, - string: string, + raw: raw, + stringified: stringified, }; } diff --git a/packages/react-scripts/config/webpack.config.dev.js b/packages/react-scripts/config/webpack.config.dev.js index 7f3b26202e8..cbac62595b1 100644 --- a/packages/react-scripts/config/webpack.config.dev.js +++ b/packages/react-scripts/config/webpack.config.dev.js @@ -206,7 +206,7 @@ module.exports = { // The public URL is available as %PUBLIC_URL% in index.html, e.g.: // // In development, this will be an empty string. - new InterpolateHtmlPlugin(env.vars), + new InterpolateHtmlPlugin(env.raw), // Generates an `index.html` file with the