| 
									
										
										
										
											2018-04-12 17:04:49 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2018-07-30 23:08:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 17:04:49 +08:00
										 |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const Chunk = require("./Chunk"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-28 20:07:40 +08:00
										 |  |  | /** @typedef {import("./ChunkGraph")} ChunkGraph */ | 
					
						
							|  |  |  | /** @typedef {import("./util/createHash").Hash} Hash */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 17:04:49 +08:00
										 |  |  | class HotUpdateChunk extends Chunk { | 
					
						
							|  |  |  | 	constructor() { | 
					
						
							|  |  |  | 		super(); | 
					
						
							| 
									
										
										
										
											2018-05-11 19:16:27 +08:00
										 |  |  | 		/** @type {(string|number)[]} */ | 
					
						
							| 
									
										
										
										
											2018-04-12 17:04:49 +08:00
										 |  |  | 		this.removedModules = undefined; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-11-24 02:22:29 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-28 20:07:40 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {Hash} hash hash (will be modified) | 
					
						
							|  |  |  | 	 * @param {ChunkGraph} chunkGraph the chunk graph | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-11-24 02:22:29 +08:00
										 |  |  | 	updateHash(hash, chunkGraph) { | 
					
						
							|  |  |  | 		super.updateHash(hash, chunkGraph); | 
					
						
							|  |  |  | 		hash.update(JSON.stringify(this.removedModules)); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-04-12 17:04:49 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | module.exports = HotUpdateChunk; |