From 53c44e4f7ae938e61700c9b0158c965b7fe08834 Mon Sep 17 00:00:00 2001
From: kamijin_fanta <kamijin@live.jp>
Date: Thu, 3 May 2018 21:45:23 +0900
Subject: [PATCH] use webpack config 'config.stats'

---
 packages/react-dev-utils/WebpackDevServerUtils.js | 2 +-
 packages/react-scripts/scripts/build.js           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/packages/react-dev-utils/WebpackDevServerUtils.js b/packages/react-dev-utils/WebpackDevServerUtils.js
index 1208d7fc776..ba761624e7e 100644
--- a/packages/react-dev-utils/WebpackDevServerUtils.js
+++ b/packages/react-dev-utils/WebpackDevServerUtils.js
@@ -150,7 +150,7 @@ function createCompiler(webpack, config, appName, urls, useYarn) {
     // We have switched off the default Webpack output in WebpackDevServer
     // options so we are going to "massage" the warnings and errors and present
     // them in a readable focused way.
-    const messages = formatWebpackMessages(stats.toJson({}, true));
+    const messages = formatWebpackMessages(stats.toJson(config.stats, true));
     const isSuccessful = !messages.errors.length && !messages.warnings.length;
     if (isSuccessful) {
       console.log(chalk.green('Compiled successfully!'));
diff --git a/packages/react-scripts/scripts/build.js b/packages/react-scripts/scripts/build.js
index f69400dcf63..8c15f2a41fb 100644
--- a/packages/react-scripts/scripts/build.js
+++ b/packages/react-scripts/scripts/build.js
@@ -138,7 +138,7 @@ function build(previousFileSizes) {
       if (err) {
         return reject(err);
       }
-      const messages = formatWebpackMessages(stats.toJson({}, true));
+      const messages = formatWebpackMessages(stats.toJson(config.stats, true));
       if (messages.errors.length) {
         // Only keep the first error. Others are often indicative
         // of the same problem, but confuse the reader with noise.