|
2 | 2 | MIT License http://www.opensource.org/licenses/mit-license.php |
3 | 3 | Author Tobias Koppers @sokra |
4 | 4 | */ |
5 | | -function NoErrorsPlugin() {} |
| 5 | +"use strict"; |
6 | 6 |
|
7 | | -var deprecationReported = false; |
| 7 | +let deprecationReported = false; |
8 | 8 |
|
9 | | -module.exports = NoErrorsPlugin; |
10 | | -NoErrorsPlugin.prototype.apply = function(compiler) { |
11 | | - compiler.plugin("should-emit", function(compilation) { |
12 | | - if(!deprecationReported) { |
13 | | - compilation.warnings.push("webpack: Using NoErrorsPlugin is deprecated.\n" + |
14 | | - "Use NoEmitOnErrorsPlugin instead.\n"); |
15 | | - deprecationReported = true; |
16 | | - } |
17 | | - if(compilation.errors.length > 0) |
18 | | - return false; |
19 | | - }); |
20 | | - compiler.plugin("compilation", function(compilation) { |
21 | | - compilation.plugin("should-record", function() { |
| 9 | +class NoErrorsPlugin { |
| 10 | + apply(compiler) { |
| 11 | + compiler.plugin("should-emit", (compilation) => { |
| 12 | + if(!deprecationReported) { |
| 13 | + compilation.warnings.push("webpack: Using NoErrorsPlugin is deprecated.\n" + |
| 14 | + "Use NoEmitOnErrorsPlugin instead.\n"); |
| 15 | + deprecationReported = true; |
| 16 | + } |
22 | 17 | if(compilation.errors.length > 0) |
23 | 18 | return false; |
24 | 19 | }); |
25 | | - }); |
26 | | -}; |
| 20 | + compiler.plugin("compilation", (compilation) => { |
| 21 | + compilation.plugin("should-record", () => { |
| 22 | + if(compilation.errors.length > 0) |
| 23 | + return false; |
| 24 | + }); |
| 25 | + }); |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +module.exports = NoErrorsPlugin; |
0 commit comments