aboutsummaryrefslogtreecommitdiff
path: root/node_modules/webpack/lib/NoErrorsPlugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/webpack/lib/NoErrorsPlugin.js')
-rw-r--r--node_modules/webpack/lib/NoErrorsPlugin.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/node_modules/webpack/lib/NoErrorsPlugin.js b/node_modules/webpack/lib/NoErrorsPlugin.js
new file mode 100644
index 000000000..0922f72f9
--- /dev/null
+++ b/node_modules/webpack/lib/NoErrorsPlugin.js
@@ -0,0 +1,29 @@
+/*
+ MIT License http://www.opensource.org/licenses/mit-license.php
+ Author Tobias Koppers @sokra
+*/
+"use strict";
+
+let deprecationReported = false;
+
+class NoErrorsPlugin {
+ apply(compiler) {
+ compiler.plugin("should-emit", (compilation) => {
+ if(!deprecationReported) {
+ compilation.warnings.push("webpack: Using NoErrorsPlugin is deprecated.\n" +
+ "Use NoEmitOnErrorsPlugin instead.\n");
+ deprecationReported = true;
+ }
+ if(compilation.errors.length > 0)
+ return false;
+ });
+ compiler.plugin("compilation", (compilation) => {
+ compilation.plugin("should-record", () => {
+ if(compilation.errors.length > 0)
+ return false;
+ });
+ });
+ }
+}
+
+module.exports = NoErrorsPlugin;