| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-08 00:06:08 +08:00
										 |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const NodeMainTemplatePlugin = require("./NodeMainTemplatePlugin"); | 
					
						
							|  |  |  | const NodeChunkTemplatePlugin = require("./NodeChunkTemplatePlugin"); | 
					
						
							|  |  |  | const NodeHotUpdateChunkTemplatePlugin = require("./NodeHotUpdateChunkTemplatePlugin"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class NodeTemplatePlugin { | 
					
						
							|  |  |  | 	constructor(options) { | 
					
						
							|  |  |  | 		options = options || {}; | 
					
						
							|  |  |  | 		this.asyncChunkLoading = options.asyncChunkLoading; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	apply(compiler) { | 
					
						
							|  |  |  | 		compiler.plugin("this-compilation", (compilation) => { | 
					
						
							|  |  |  | 			compilation.mainTemplate.apply(new NodeMainTemplatePlugin(this.asyncChunkLoading)); | 
					
						
							|  |  |  | 			compilation.chunkTemplate.apply(new NodeChunkTemplatePlugin()); | 
					
						
							|  |  |  | 			compilation.hotUpdateChunkTemplate.apply(new NodeHotUpdateChunkTemplatePlugin()); | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2017-01-08 00:06:08 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-01 16:44:58 +08:00
										 |  |  | module.exports = NodeTemplatePlugin; |