| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2018-07-30 23:08:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-21 07:05:34 +08:00
										 |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-25 16:07:16 +08:00
										 |  |  | const ArrayPushCallbackChunkFormatPlugin = require("../javascript/ArrayPushCallbackChunkFormatPlugin"); | 
					
						
							| 
									
										
										
										
											2020-08-26 03:45:56 +08:00
										 |  |  | const EnableChunkLoadingPlugin = require("../javascript/EnableChunkLoadingPlugin"); | 
					
						
							| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-09 05:59:19 +08:00
										 |  |  | /** @typedef {import("../Compiler")} Compiler */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-02-21 07:05:34 +08:00
										 |  |  | class WebWorkerTemplatePlugin { | 
					
						
							| 
									
										
										
										
											2018-11-09 05:59:19 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2020-04-23 16:48:36 +08:00
										 |  |  | 	 * Apply the plugin | 
					
						
							| 
									
										
										
										
											2018-11-09 05:59:19 +08:00
										 |  |  | 	 * @param {Compiler} compiler the compiler instance | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2017-02-21 07:05:34 +08:00
										 |  |  | 	apply(compiler) { | 
					
						
							| 
									
										
										
										
											2020-08-26 03:45:56 +08:00
										 |  |  | 		compiler.options.output.chunkLoading = "import-scripts"; | 
					
						
							| 
									
										
										
										
											2020-08-25 16:07:16 +08:00
										 |  |  | 		new ArrayPushCallbackChunkFormatPlugin().apply(compiler); | 
					
						
							| 
									
										
										
										
											2020-08-26 03:45:56 +08:00
										 |  |  | 		new EnableChunkLoadingPlugin("import-scripts").apply(compiler); | 
					
						
							| 
									
										
										
										
											2017-02-21 07:05:34 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2025-07-02 20:10:54 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | module.exports = WebWorkerTemplatePlugin; |