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.