Skip to content

Commit 568161d

Browse files
committedFeb 18, 2019
fix(bin): use compiler.close API correctly for stats
This fixes #762 ISSUES CLOSED: #762
1 parent 62ab32d commit 568161d

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed
 

‎bin/cli.js

+10-5
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ For more information, see https://webpack.js.org/api/cli/.`);
251251
const stdout = argv.silent
252252
? {
253253
write: () => {}
254-
} // eslint-disable-line
254+
} // eslint-disable-line
255255
: process.stdout;
256256

257257
function ifArg(name, fn, init) {
@@ -488,13 +488,18 @@ For more information, see https://webpack.js.org/api/cli/.`);
488488
}
489489
compiler.watch(watchOptions, compilerCallback);
490490
if (outputOptions.infoVerbosity !== "none") console.error("\nwebpack is watching the files…\n");
491-
if (compiler.close) compiler.close(compilerCallback);
492491
} else {
493-
compiler.run(compilerCallback);
494-
if (compiler.close) compiler.close(compilerCallback);
492+
compiler.run((err, stats) => {
493+
if (compiler.close) {
494+
compiler.close(err2 => {
495+
compilerCallback(err || err2, stats);
496+
});
497+
} else {
498+
compilerCallback(err, stats);
499+
}
500+
});
495501
}
496502
}
497-
498503
processOptions(options);
499504
});
500505
})();

0 commit comments

Comments
 (0)
Please sign in to comment.