| 
									
										
										
										
											2018-11-06 01:50:58 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const RuntimeGlobals = require("../RuntimeGlobals"); | 
					
						
							|  |  |  | const RuntimeModule = require("../RuntimeModule"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-18 05:05:08 +08:00
										 |  |  | /** @typedef {import("../Compilation")} Compilation */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-06 01:50:58 +08:00
										 |  |  | class GetFullHashRuntimeModule extends RuntimeModule { | 
					
						
							| 
									
										
										
										
											2019-08-27 02:21:07 +08:00
										 |  |  | 	constructor() { | 
					
						
							| 
									
										
										
										
											2018-11-06 01:50:58 +08:00
										 |  |  | 		super("getFullHash"); | 
					
						
							| 
									
										
										
										
											2020-09-02 00:09:28 +08:00
										 |  |  | 		this.fullHash = true; | 
					
						
							| 
									
										
										
										
											2018-11-06 01:50:58 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {string} runtime code | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-11-20 19:05:12 +08:00
										 |  |  | 	generate() { | 
					
						
							| 
									
										
										
										
											2019-08-27 02:21:07 +08:00
										 |  |  | 		const { runtimeTemplate } = this.compilation; | 
					
						
							|  |  |  | 		return `${RuntimeGlobals.getFullHash} = ${runtimeTemplate.returningFunction( | 
					
						
							|  |  |  | 			JSON.stringify(this.compilation.hash || "XXXX") | 
					
						
							|  |  |  | 		)}`;
 | 
					
						
							| 
									
										
										
										
											2018-11-06 01:50:58 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = GetFullHashRuntimeModule; |