| 
									
										
										
										
											2016-12-30 16:52:37 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2017-01-19 03:44:27 +08:00
										 |  |  | "use strict"; | 
					
						
							| 
									
										
										
										
											2016-12-30 16:52:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-19 03:44:27 +08:00
										 |  |  | class NoEmitOnErrorsPlugin { | 
					
						
							|  |  |  | 	apply(compiler) { | 
					
						
							|  |  |  | 		compiler.plugin("should-emit", (compilation) => { | 
					
						
							| 
									
										
										
										
											2016-12-30 16:52:37 +08:00
										 |  |  | 			if(compilation.errors.length > 0) | 
					
						
							|  |  |  | 				return false; | 
					
						
							|  |  |  | 		}); | 
					
						
							| 
									
										
										
										
											2017-01-19 03:44:27 +08:00
										 |  |  | 		compiler.plugin("compilation", (compilation) => { | 
					
						
							|  |  |  | 			compilation.plugin("should-record", () => { | 
					
						
							|  |  |  | 				if(compilation.errors.length > 0) | 
					
						
							|  |  |  | 					return false; | 
					
						
							|  |  |  | 			}); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = NoEmitOnErrorsPlugin; |