Skip to content

Commit

Permalink
fix(bin): use compiler.close API correctly for stats
Browse files Browse the repository at this point in the history
This fixes #762

ISSUES CLOSED: #762
  • Loading branch information
TheLarkInn committed Feb 18, 2019
1 parent 62ab32d commit 568161d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ For more information, see https://webpack.js.org/api/cli/.`);
const stdout = argv.silent
? {
write: () => {}
} // eslint-disable-line
} // eslint-disable-line
: process.stdout;

function ifArg(name, fn, init) {
Expand Down Expand Up @@ -488,13 +488,18 @@ For more information, see https://webpack.js.org/api/cli/.`);
}
compiler.watch(watchOptions, compilerCallback);
if (outputOptions.infoVerbosity !== "none") console.error("\nwebpack is watching the files…\n");
if (compiler.close) compiler.close(compilerCallback);
} else {
compiler.run(compilerCallback);
if (compiler.close) compiler.close(compilerCallback);
compiler.run((err, stats) => {
if (compiler.close) {
compiler.close(err2 => {
compilerCallback(err || err2, stats);
});
} else {
compilerCallback(err, stats);
}
});
}
}

processOptions(options);
});
})();

0 comments on commit 568161d

Please sign in to comment.