mirror of https://github.com/webpack/webpack.git
Remove unnecessary handler wrapper
This commit is contained in:
parent
ea6e173551
commit
ccc32d31bf
|
|
@ -189,16 +189,10 @@ module.exports = class MultiCompiler extends Tapable {
|
|||
watch(watchOptions, handler) {
|
||||
if (this.running) return handler(new ConcurrentCompilationError());
|
||||
|
||||
const finalHandler = (err, stats) => {
|
||||
this.running = false;
|
||||
|
||||
if (handler !== undefined) handler(err, stats);
|
||||
};
|
||||
|
||||
let watchings = [];
|
||||
let allStats = this.compilers.map(() => null);
|
||||
let compilerStatus = this.compilers.map(() => false);
|
||||
if (this.validateDependencies(finalHandler)) {
|
||||
if (this.validateDependencies(handler)) {
|
||||
this.running = true;
|
||||
this.runWithDependencies(
|
||||
this.compilers,
|
||||
|
|
@ -210,7 +204,7 @@ module.exports = class MultiCompiler extends Tapable {
|
|||
? watchOptions[compilerIdx]
|
||||
: watchOptions,
|
||||
(err, stats) => {
|
||||
if (err) finalHandler(err);
|
||||
if (err) handler(err);
|
||||
if (stats) {
|
||||
allStats[compilerIdx] = stats;
|
||||
compilerStatus[compilerIdx] = "new";
|
||||
|
|
@ -220,7 +214,7 @@ module.exports = class MultiCompiler extends Tapable {
|
|||
});
|
||||
compilerStatus.fill(true);
|
||||
const multiStats = new MultiStats(freshStats);
|
||||
finalHandler(null, multiStats);
|
||||
handler(null, multiStats);
|
||||
}
|
||||
}
|
||||
if (firstRun && !err) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue