Skip to content

Commit 6f941ab

Browse files
committed
fixed command line spamming
1 parent 5264f69 commit 6f941ab

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

bin/webpack.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,15 @@ ifArg("hide-modules", function(bool) {
125125
var webpack = require("../lib/webpack.js");
126126

127127
Error.stackTrackLimit = 30;
128+
var lastHash = null;
128129
var compiler = webpack(options, function(err, stats) {
129130
if(!options.watch) {
130131
// Do not keep cache anymore
131132
var ifs = compiler.inputFileSystem;
132133
if(ifs && ifs.purge) ifs.purge();
133134
}
134135
if(err) {
136+
lastHash = null;
135137
console.error(err.stack || err);
136138
if(err.details) console.error(err.details);
137139
if(!options.watch) {
@@ -141,9 +143,10 @@ var compiler = webpack(options, function(err, stats) {
141143
}
142144
return;
143145
}
144-
if(outputOptions.json)
146+
if(outputOptions.json) {
145147
process.stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n");
146-
else {
148+
} else if(stats.compilation.hash !== lastHash) {
149+
lastHash = stats.compilation.hash;
147150
process.stdout.write(stats.toString(outputOptions) + "\n");
148151
}
149152
});

0 commit comments

Comments
 (0)