| 
									
										
										
										
											2018-11-06 02:04:41 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const RuntimeGlobals = require("../RuntimeGlobals"); | 
					
						
							|  |  |  | const RuntimeModule = require("../RuntimeModule"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ChunkNameRuntimeModule extends RuntimeModule { | 
					
						
							| 
									
										
										
										
											2018-12-18 05:05:08 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {string} chunkName the chunk's name | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-11-06 02:04:41 +08:00
										 |  |  | 	constructor(chunkName) { | 
					
						
							|  |  |  | 		super("chunkName"); | 
					
						
							|  |  |  | 		this.chunkName = chunkName; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2023-06-17 01:13:03 +08:00
										 |  |  | 	 * @returns {string | null} runtime code | 
					
						
							| 
									
										
										
										
											2018-11-06 02:04:41 +08:00
										 |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-11-20 19:05:12 +08:00
										 |  |  | 	generate() { | 
					
						
							| 
									
										
										
										
											2018-11-06 02:04:41 +08:00
										 |  |  | 		return `${RuntimeGlobals.chunkName} = ${JSON.stringify(this.chunkName)};`; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = ChunkNameRuntimeModule; |