| 
									
										
										
										
											2013-03-26 23:54:41 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | var ConcatSource = require("webpack-core/lib/ConcatSource"); | 
					
						
							|  |  |  | var Template = require("./Template"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function ChunkTemplate(outputOptions) { | 
					
						
							|  |  |  | 	Template.call(this, outputOptions); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = ChunkTemplate; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ChunkTemplate.prototype = Object.create(Template.prototype); | 
					
						
							|  |  |  | ChunkTemplate.prototype.render = function(chunk, moduleTemplate, dependencyTemplates) { | 
					
						
							|  |  |  | 	var source = new ConcatSource(); | 
					
						
							|  |  |  | 	source.add(this.asString(this.renderHeader(chunk))); | 
					
						
							| 
									
										
										
										
											2013-12-13 19:58:10 +08:00
										 |  |  | 	source.add(this.renderChunkModules(chunk, moduleTemplate, dependencyTemplates)); | 
					
						
							| 
									
										
										
										
											2013-03-26 23:54:41 +08:00
										 |  |  | 	source.add(this.asString(this.renderFooter(chunk))); | 
					
						
							| 
									
										
										
										
											2013-05-08 19:28:54 +08:00
										 |  |  | 	chunk.rendered = true; | 
					
						
							| 
									
										
										
										
											2013-03-26 23:54:41 +08:00
										 |  |  | 	return source; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ChunkTemplate.prototype.renderHeader = function(chunk) { | 
					
						
							| 
									
										
										
										
											2013-12-13 19:58:10 +08:00
										 |  |  | 	return []; | 
					
						
							| 
									
										
										
										
											2013-03-26 23:54:41 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ChunkTemplate.prototype.renderFooter = function(chunk) { | 
					
						
							| 
									
										
										
										
											2013-12-13 19:58:10 +08:00
										 |  |  | 	return []; | 
					
						
							| 
									
										
										
										
											2013-03-26 23:54:41 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ChunkTemplate.prototype.updateHash = function(hash) { | 
					
						
							| 
									
										
										
										
											2013-06-19 17:53:03 +08:00
										 |  |  | 	hash.update("ChunkTemplate"); | 
					
						
							| 
									
										
										
										
											2013-12-13 19:58:10 +08:00
										 |  |  | 	hash.update("2"); | 
					
						
							| 
									
										
										
										
											2013-03-26 23:54:41 +08:00
										 |  |  | }; |