| 
									
										
										
										
											2014-09-03 20:16:17 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2017-01-19 03:30:53 +08:00
										 |  |  | "use strict"; | 
					
						
							| 
									
										
										
										
											2016-12-30 16:52:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-19 03:30:53 +08:00
										 |  |  | let deprecationReported = false; | 
					
						
							| 
									
										
										
										
											2016-12-30 16:52:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-19 03:30:53 +08:00
										 |  |  | 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; | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2015-07-16 06:19:23 +08:00
										 |  |  | 			if(compilation.errors.length > 0) | 
					
						
							| 
									
										
										
										
											2014-09-03 20:16:17 +08:00
										 |  |  | 				return false; | 
					
						
							|  |  |  | 		}); | 
					
						
							| 
									
										
										
										
											2017-01-19 03:30:53 +08:00
										 |  |  | 		compiler.plugin("compilation", (compilation) => { | 
					
						
							|  |  |  | 			compilation.plugin("should-record", () => { | 
					
						
							|  |  |  | 				if(compilation.errors.length > 0) | 
					
						
							|  |  |  | 					return false; | 
					
						
							|  |  |  | 			}); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = NoErrorsPlugin; |