2014-09-03 20:16:17 +08:00
|
|
|
/*
|
|
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
|
|
Author Tobias Koppers @sokra
|
|
|
|
*/
|
2015-07-13 06:20:09 +08:00
|
|
|
function NoErrorsPlugin() {}
|
2016-12-30 16:52:37 +08:00
|
|
|
|
|
|
|
var deprecationReported = false;
|
|
|
|
|
2014-09-03 20:16:17 +08:00
|
|
|
module.exports = NoErrorsPlugin;
|
|
|
|
NoErrorsPlugin.prototype.apply = function(compiler) {
|
|
|
|
compiler.plugin("should-emit", function(compilation) {
|
2016-12-30 16:52:37 +08:00
|
|
|
if(!deprecationReported) {
|
|
|
|
compilation.warnings.push("webpack: Using NoErrorsPlugin is deprecated.\n" +
|
|
|
|
"Use NoEmitOnErrorsPlugin instead.\n");
|
|
|
|
deprecationReported = true;
|
|
|
|
}
|
2015-07-16 06:19:23 +08:00
|
|
|
if(compilation.errors.length > 0)
|
2014-09-03 20:16:17 +08:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
compiler.plugin("compilation", function(compilation) {
|
|
|
|
compilation.plugin("should-record", function() {
|
2015-07-16 06:19:23 +08:00
|
|
|
if(compilation.errors.length > 0)
|
2014-09-03 20:16:17 +08:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|