From 06ebc25556472e20d64a0cca9edb4b18e9ce9b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Zugmeyer?= Date: Fri, 3 Nov 2017 17:00:49 +0100 Subject: [PATCH] don't mutate stats configuration The webpack configuration `stats` property has the same format as the `devServer.stats` property, so the same object is frequently reused to define the same stats output. Since webpack v3.8.0, the `stats` property is validated more strictly by webpack. webpack-dev-server is mutating this `stats` object by adding a `colors` property, which is an object and doesn't match the webpack configuration schema, causing a fatal error. The easy fix is to *not* mutate the `stats` object, so webpack isn't breaking with a fatal error. But we may also consider setting a valid `colors` property. --- bin/webpack-dev-server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/webpack-dev-server.js b/bin/webpack-dev-server.js index 05c2952455..59868650b5 100755 --- a/bin/webpack-dev-server.js +++ b/bin/webpack-dev-server.js @@ -294,7 +294,9 @@ function processOptions(webpackOptions) { }; } - if (typeof options.stats === 'object' && typeof options.stats.colors === 'undefined') { options.stats.colors = argv.color; } + if (typeof options.stats === 'object' && typeof options.stats.colors === 'undefined') { + options.stats = Object.assign({}, options.stats, { colors: argv.color }); + } if (argv.lazy) { options.lazy = true; }