Skip to content

Commit 7a0dc0c

Browse files
committed
Fix compile errors appearing twice.
The `errorDetails` option for `stats.toJson` defaults to true. This causes error messages to contain the same message twice. Fixes webpack/webpack#3008
1 parent 06c7773 commit 7a0dc0c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ var httpProxyMiddleware = require("http-proxy-middleware");
1111
var serveIndex = require("serve-index");
1212
var historyApiFallback = require("connect-history-api-fallback");
1313

14+
var clientStats = { errorDetails: false };
15+
1416
function Server(compiler, options) {
1517
// Default options
1618
if(!options) options = {};
@@ -32,7 +34,7 @@ function Server(compiler, options) {
3234
compiler.plugin("compile", invalidPlugin);
3335
compiler.plugin("invalid", invalidPlugin);
3436
compiler.plugin("done", function(stats) {
35-
this._sendStats(this.sockets, stats.toJson());
37+
this._sendStats(this.sockets, stats.toJson(clientStats));
3638
this._stats = stats;
3739
}.bind(this));
3840

@@ -389,7 +391,7 @@ Server.prototype.listen = function() {
389391
if(this.hot) this.sockWrite([conn], "hot");
390392

391393
if(!this._stats) return;
392-
this._sendStats([conn], this._stats.toJson(), true);
394+
this._sendStats([conn], this._stats.toJson(clientStats), true);
393395
}.bind(this));
394396

395397
sockServer.installHandlers(this.listeningApp, {

0 commit comments

Comments
 (0)