| 
									
										
										
										
											2015-05-17 00:27:59 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							| 
									
										
										
										
											2017-01-05 14:03:19 +08:00
										 |  |  | 	*/ | 
					
						
							|  |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-22 19:05:58 +08:00
										 |  |  | const { RawSource } = require("webpack-sources"); | 
					
						
							| 
									
										
										
										
											2017-01-05 14:03:19 +08:00
										 |  |  | const Module = require("./Module"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DllModule extends Module { | 
					
						
							|  |  |  | 	constructor(context, dependencies, name, type) { | 
					
						
							| 
									
										
										
										
											2018-01-31 04:40:44 +08:00
										 |  |  | 		super("javascript/dynamic", context); | 
					
						
							| 
									
										
										
										
											2017-11-06 20:02:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		// Info from Factory
 | 
					
						
							| 
									
										
										
										
											2017-01-05 14:03:19 +08:00
										 |  |  | 		this.dependencies = dependencies; | 
					
						
							|  |  |  | 		this.name = name; | 
					
						
							|  |  |  | 		this.type = type; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	identifier() { | 
					
						
							|  |  |  | 		return `dll ${this.name}`; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	readableIdentifier() { | 
					
						
							|  |  |  | 		return `dll ${this.name}`; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	build(options, compilation, resolver, fs, callback) { | 
					
						
							|  |  |  | 		this.built = true; | 
					
						
							| 
									
										
										
										
											2017-12-06 19:09:17 +08:00
										 |  |  | 		this.buildMeta = {}; | 
					
						
							|  |  |  | 		this.buildInfo = {}; | 
					
						
							| 
									
										
										
										
											2017-01-05 14:03:19 +08:00
										 |  |  | 		return callback(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	source() { | 
					
						
							|  |  |  | 		return new RawSource("module.exports = __webpack_require__;"); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	needRebuild() { | 
					
						
							|  |  |  | 		return false; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	size() { | 
					
						
							|  |  |  | 		return 12; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	updateHash(hash) { | 
					
						
							|  |  |  | 		hash.update("dll module"); | 
					
						
							|  |  |  | 		hash.update(this.name || ""); | 
					
						
							|  |  |  | 		super.updateHash(hash); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-05-17 00:27:59 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-05 14:03:19 +08:00
										 |  |  | module.exports = DllModule; |