| 
									
										
										
										
											2025-05-01 22:36:51 +08:00
										 |  |  | /** @typedef {import("../../../../").Compiler} Compiler */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-21 23:39:15 +08:00
										 |  |  | class ThrowsExceptionInRender { | 
					
						
							| 
									
										
										
										
											2025-05-01 22:36:51 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {Compiler} compiler compiler | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-09-21 23:39:15 +08:00
										 |  |  | 	apply(compiler) { | 
					
						
							|  |  |  | 		compiler.hooks.compilation.tap("ThrowsException", compilation => { | 
					
						
							|  |  |  | 			compilation.mainTemplate.hooks.requireExtensions.tap( | 
					
						
							|  |  |  | 				"ThrowsException", | 
					
						
							|  |  |  | 				() => { | 
					
						
							|  |  |  | 					throw new Error("Test exception"); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-20 13:36:55 +08:00
										 |  |  | /** @type {import("../../../../").Configuration} */ | 
					
						
							| 
									
										
										
										
											2018-09-21 23:39:15 +08:00
										 |  |  | module.exports = { | 
					
						
							|  |  |  | 	plugins: [new ThrowsExceptionInRender()] | 
					
						
							|  |  |  | }; |