Skip to content

Commit 9795efd

Browse files
committed
Merge pull request #13 from alexhancock/master
[output] Add a minimal output option for the middleware
2 parents 5136829 + 68ac9ac commit 9795efd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

middleware.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var mime = require("mime");
1010
module.exports = function(compiler, options) {
1111
if(!options) options = {};
1212
if(options.watchDelay === undefined) options.watchDelay = 200;
13-
if(!options.stats) options.stats = {};
13+
if(typeof options.stats === "undefined") options.stats = {};
1414
if(!options.stats.context) options.stats.context = process.cwd();
1515

1616
// store our files in memory
@@ -27,15 +27,15 @@ module.exports = function(compiler, options) {
2727
// check if still in valid state
2828
if(!state) return;
2929
// print webpack output
30-
var displayStats = !options.quiet;
30+
var displayStats = (!options.quiet && options.stats !== false);
3131
if(displayStats &&
3232
!(stats.hasErrors() || stats.hasWarnings()) &&
3333
options.noInfo)
3434
displayStats = false;
3535
if(displayStats) {
3636
console.log(stats.toString(options.stats));
3737
}
38-
if(!options.noInfo && !options.quiet)
38+
if (!options.noInfo && !options.quiet)
3939
console.info("webpack: bundle is now VALID.");
4040

4141
// execute callback that are delayed
@@ -56,7 +56,7 @@ module.exports = function(compiler, options) {
5656
// on compiling
5757
function invalidPlugin() {
5858
if(state && (!options.noInfo && !options.quiet))
59-
console.info("webpack: bundle is now invalid.");
59+
console.info("webpack: bundle is now INVALID.");
6060
// We are now in invalid state
6161
state = false;
6262
}

0 commit comments

Comments
 (0)