You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

NoEmitOnErrorsPlugin.js 559B

1234567891011121314151617181920
  1. /*
  2. MIT License http://www.opensource.org/licenses/mit-license.php
  3. Author Tobias Koppers @sokra
  4. */
  5. "use strict";
  6. class NoEmitOnErrorsPlugin {
  7. apply(compiler) {
  8. compiler.hooks.shouldEmit.tap("NoEmitOnErrorsPlugin", compilation => {
  9. if (compilation.getStats().hasErrors()) return false;
  10. });
  11. compiler.hooks.compilation.tap("NoEmitOnErrorsPlugin", compilation => {
  12. compilation.hooks.shouldRecord.tap("NoEmitOnErrorsPlugin", () => {
  13. if (compilation.getStats().hasErrors()) return false;
  14. });
  15. });
  16. }
  17. }
  18. module.exports = NoEmitOnErrorsPlugin;