| 
									
										
										
										
											2013-01-31 01:49:25 +08:00
										 |  |  | /* | 
					
						
							|  |  |  | 	MIT License http://www.opensource.org/licenses/mit-license.php
 | 
					
						
							|  |  |  | 	Author Tobias Koppers @sokra | 
					
						
							|  |  |  | */ | 
					
						
							| 
									
										
										
										
											2018-07-30 23:08:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | "use strict"; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | const util = require("util"); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | const ChunkGraph = require("./ChunkGraph"); | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | const DependenciesBlock = require("./DependenciesBlock"); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | const ModuleGraph = require("./ModuleGraph"); | 
					
						
							| 
									
										
										
										
											2020-07-28 01:36:06 +08:00
										 |  |  | const RuntimeGlobals = require("./RuntimeGlobals"); | 
					
						
							| 
									
										
										
										
											2021-02-04 21:21:27 +08:00
										 |  |  | const { first } = require("./util/SetHelpers"); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | const { compareChunksById } = require("./util/comparators"); | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | const makeSerializable = require("./util/makeSerializable"); | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-30 23:08:51 +08:00
										 |  |  | /** @typedef {import("webpack-sources").Source} Source */ | 
					
						
							| 
									
										
										
										
											2020-08-03 02:09:36 +08:00
										 |  |  | /** @typedef {import("../declarations/WebpackOptions").ResolveOptions} ResolveOptions */ | 
					
						
							| 
									
										
										
										
											2020-02-17 17:27:46 +08:00
										 |  |  | /** @typedef {import("../declarations/WebpackOptions").WebpackOptionsNormalized} WebpackOptions */ | 
					
						
							| 
									
										
										
										
											2018-04-21 07:51:40 +08:00
										 |  |  | /** @typedef {import("./Chunk")} Chunk */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | /** @typedef {import("./ChunkGroup")} ChunkGroup */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | /** @typedef {import("./Compilation")} Compilation */ | 
					
						
							| 
									
										
										
										
											2020-09-11 15:06:24 +08:00
										 |  |  | /** @typedef {import("./ConcatenationScope")} ConcatenationScope */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | /** @typedef {import("./Dependency")} Dependency */ | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | /** @typedef {import("./Dependency").UpdateHashContext} UpdateHashContext */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | /** @typedef {import("./DependencyTemplates")} DependencyTemplates */ | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | /** @typedef {import("./ExportsInfo").UsageStateType} UsageStateType */ | 
					
						
							| 
									
										
										
										
											2018-09-27 13:22:19 +08:00
										 |  |  | /** @typedef {import("./FileSystemInfo")} FileSystemInfo */ | 
					
						
							| 
									
										
										
										
											2020-10-05 22:57:31 +08:00
										 |  |  | /** @typedef {import("./ModuleGraphConnection").ConnectionState} ConnectionState */ | 
					
						
							| 
									
										
										
										
											2018-07-30 23:08:51 +08:00
										 |  |  | /** @typedef {import("./RequestShortener")} RequestShortener */ | 
					
						
							| 
									
										
										
										
											2019-11-11 22:25:03 +08:00
										 |  |  | /** @typedef {import("./ResolverFactory").ResolverWithOptions} ResolverWithOptions */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | /** @typedef {import("./RuntimeTemplate")} RuntimeTemplate */ | 
					
						
							| 
									
										
										
										
											2018-05-04 00:57:02 +08:00
										 |  |  | /** @typedef {import("./WebpackError")} WebpackError */ | 
					
						
							| 
									
										
										
										
											2019-07-17 22:02:33 +08:00
										 |  |  | /** @typedef {import("./util/Hash")} Hash */ | 
					
						
							| 
									
										
										
										
											2020-08-23 03:54:34 +08:00
										 |  |  | /** @template T @typedef {import("./util/LazySet")<T>} LazySet<T> */ | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | /** @template T @typedef {import("./util/SortableSet")<T>} SortableSet<T> */ | 
					
						
							| 
									
										
										
										
											2019-11-11 22:25:03 +08:00
										 |  |  | /** @typedef {import("./util/fs").InputFileSystem} InputFileSystem */ | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ | 
					
						
							| 
									
										
										
										
											2018-04-12 15:18:53 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-18 00:57:03 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @typedef {Object} SourceContext | 
					
						
							|  |  |  |  * @property {DependencyTemplates} dependencyTemplates the dependency templates | 
					
						
							|  |  |  |  * @property {RuntimeTemplate} runtimeTemplate the runtime template | 
					
						
							| 
									
										
										
										
											2018-07-24 23:35:36 +08:00
										 |  |  |  * @property {ModuleGraph} moduleGraph the module graph | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  |  * @property {ChunkGraph} chunkGraph the chunk graph | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  |  * @property {RuntimeSpec} runtime the runtimes code should be generated for | 
					
						
							| 
									
										
										
										
											2018-07-18 00:57:03 +08:00
										 |  |  |  * @property {string=} type the type of source that should be generated | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @typedef {Object} CodeGenerationContext | 
					
						
							|  |  |  |  * @property {DependencyTemplates} dependencyTemplates the dependency templates | 
					
						
							|  |  |  |  * @property {RuntimeTemplate} runtimeTemplate the runtime template | 
					
						
							|  |  |  |  * @property {ModuleGraph} moduleGraph the module graph | 
					
						
							|  |  |  |  * @property {ChunkGraph} chunkGraph the chunk graph | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  |  * @property {RuntimeSpec} runtime the runtimes code should be generated for | 
					
						
							| 
									
										
										
										
											2020-09-11 15:06:24 +08:00
										 |  |  |  * @property {ConcatenationScope=} concatenationScope when in concatenated module, information about other concatenated modules | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-15 16:07:04 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @typedef {Object} ConcatenationBailoutReasonContext | 
					
						
							|  |  |  |  * @property {ModuleGraph} moduleGraph the module graph | 
					
						
							|  |  |  |  * @property {ChunkGraph} chunkGraph the chunk graph | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @typedef {Object} CodeGenerationResult | 
					
						
							|  |  |  |  * @property {Map<string, Source>} sources the resulting sources for all source types | 
					
						
							| 
									
										
										
										
											2020-05-23 22:08:51 +08:00
										 |  |  |  * @property {Map<string, any>=} data the resulting data for all source types | 
					
						
							| 
									
										
										
										
											2020-01-29 17:28:33 +08:00
										 |  |  |  * @property {ReadonlySet<string>} runtimeRequirements the runtime requirements | 
					
						
							| 
									
										
										
										
											2021-01-26 07:48:37 +08:00
										 |  |  |  * @property {string=} hash a hash of the code generation result (will be automatically calculated from sources and runtimeRequirements if not provided) | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-20 22:24:35 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @typedef {Object} LibIdentOptions | 
					
						
							|  |  |  |  * @property {string} context absolute context path to which lib ident is relative to | 
					
						
							| 
									
										
										
										
											2019-01-19 19:40:00 +08:00
										 |  |  |  * @property {Object=} associatedObjectForCache object for caching | 
					
						
							| 
									
										
										
										
											2018-07-20 22:24:35 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-07 01:39:43 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @typedef {Object} KnownBuildMeta | 
					
						
							| 
									
										
										
										
											2019-06-05 17:15:25 +08:00
										 |  |  |  * @property {string=} moduleArgument | 
					
						
							|  |  |  |  * @property {string=} exportsArgument | 
					
						
							|  |  |  |  * @property {boolean=} strict | 
					
						
							|  |  |  |  * @property {string=} moduleConcatenationBailout | 
					
						
							| 
									
										
										
										
											2020-08-18 03:32:47 +08:00
										 |  |  |  * @property {("default" | "namespace" | "flagged" | "dynamic")=} exportsType | 
					
						
							| 
									
										
										
										
											2020-07-08 16:58:20 +08:00
										 |  |  |  * @property {(false | "redirect" | "redirect-warn")=} defaultObject | 
					
						
							| 
									
										
										
										
											2019-06-05 17:15:25 +08:00
										 |  |  |  * @property {boolean=} strictHarmonyModule | 
					
						
							|  |  |  |  * @property {boolean=} async | 
					
						
							| 
									
										
										
										
											2020-10-05 22:57:31 +08:00
										 |  |  |  * @property {boolean=} sideEffectFree | 
					
						
							| 
									
										
										
										
											2018-08-07 01:39:43 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-26 15:14:44 +08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @typedef {Object} NeedBuildContext | 
					
						
							| 
									
										
										
										
											2018-09-27 13:22:19 +08:00
										 |  |  |  * @property {FileSystemInfo} fileSystemInfo | 
					
						
							| 
									
										
										
										
											2018-09-26 15:14:44 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-07 01:39:43 +08:00
										 |  |  | /** @typedef {KnownBuildMeta & Record<string, any>} BuildMeta */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-17 21:26:23 +08:00
										 |  |  | const EMPTY_RESOLVE_OPTIONS = {}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | let debugId = 1000; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-26 21:51:40 +08:00
										 |  |  | const DEFAULT_TYPES_UNKNOWN = new Set(["unknown"]); | 
					
						
							|  |  |  | const DEFAULT_TYPES_JS = new Set(["javascript"]); | 
					
						
							| 
									
										
										
										
											2018-12-03 22:00:32 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-15 20:33:50 +08:00
										 |  |  | const deprecatedNeedRebuild = util.deprecate( | 
					
						
							|  |  |  | 	(module, context) => { | 
					
						
							|  |  |  | 		return module.needRebuild( | 
					
						
							|  |  |  | 			context.fileSystemInfo.getDeprecatedFileTimestamps(), | 
					
						
							|  |  |  | 			context.fileSystemInfo.getDeprecatedContextTimestamps() | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | 	"Module.needRebuild is deprecated in favor of Module.needBuild", | 
					
						
							|  |  |  | 	"DEP_WEBPACK_MODULE_NEED_REBUILD" | 
					
						
							|  |  |  | ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 15:18:53 +08:00
										 |  |  | /** @typedef {(requestShortener: RequestShortener) => string} OptimizationBailoutFunction */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-06-19 20:13:44 +08:00
										 |  |  | class Module extends DependenciesBlock { | 
					
						
							| 
									
										
										
										
											2018-11-07 21:03:25 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {string} type the module type | 
					
						
							|  |  |  | 	 * @param {string=} context an optional context | 
					
						
							| 
									
										
										
										
											2020-12-22 21:51:09 +08:00
										 |  |  | 	 * @param {string=} layer an optional layer in which the module is | 
					
						
							| 
									
										
										
										
											2018-11-07 21:03:25 +08:00
										 |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2020-12-22 21:51:09 +08:00
										 |  |  | 	constructor(type, context = null, layer = null) { | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 		super(); | 
					
						
							| 
									
										
										
										
											2018-11-07 21:03:25 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 15:18:53 +08:00
										 |  |  | 		/** @type {string} */ | 
					
						
							| 
									
										
										
										
											2017-10-30 20:56:57 +08:00
										 |  |  | 		this.type = type; | 
					
						
							| 
									
										
										
										
											2020-12-22 21:51:09 +08:00
										 |  |  | 		/** @type {string | null} */ | 
					
						
							| 
									
										
										
										
											2018-01-31 04:40:44 +08:00
										 |  |  | 		this.context = context; | 
					
						
							| 
									
										
										
										
											2020-12-22 21:51:09 +08:00
										 |  |  | 		/** @type {string | null} */ | 
					
						
							|  |  |  | 		this.layer = layer; | 
					
						
							| 
									
										
										
										
											2019-09-26 21:51:40 +08:00
										 |  |  | 		/** @type {boolean} */ | 
					
						
							|  |  |  | 		this.needId = true; | 
					
						
							| 
									
										
										
										
											2017-11-06 20:02:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		// Unique Id
 | 
					
						
							| 
									
										
										
										
											2018-04-12 15:18:53 +08:00
										 |  |  | 		/** @type {number} */ | 
					
						
							| 
									
										
										
										
											2017-11-06 20:02:35 +08:00
										 |  |  | 		this.debugId = debugId++; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// Info from Factory
 | 
					
						
							| 
									
										
										
										
											2020-08-03 02:09:36 +08:00
										 |  |  | 		/** @type {ResolveOptions} */ | 
					
						
							| 
									
										
										
										
											2017-11-17 21:26:23 +08:00
										 |  |  | 		this.resolveOptions = EMPTY_RESOLVE_OPTIONS; | 
					
						
							| 
									
										
										
										
											2019-11-08 19:52:32 +08:00
										 |  |  | 		/** @type {object | undefined} */ | 
					
						
							|  |  |  | 		this.factoryMeta = undefined; | 
					
						
							| 
									
										
										
										
											2020-10-26 21:41:46 +08:00
										 |  |  | 		// TODO refactor this -> options object filled from Factory
 | 
					
						
							|  |  |  | 		// TODO webpack 6: use an enum
 | 
					
						
							|  |  |  | 		/** @type {boolean} */ | 
					
						
							|  |  |  | 		this.useSourceMap = false; | 
					
						
							|  |  |  | 		/** @type {boolean} */ | 
					
						
							|  |  |  | 		this.useSimpleSourceMap = false; | 
					
						
							| 
									
										
										
										
											2017-11-06 20:02:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		// Info from Build
 | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 		/** @type {WebpackError[] | undefined} */ | 
					
						
							|  |  |  | 		this._warnings = undefined; | 
					
						
							|  |  |  | 		/** @type {WebpackError[] | undefined} */ | 
					
						
							|  |  |  | 		this._errors = undefined; | 
					
						
							| 
									
										
										
										
											2018-08-07 01:39:43 +08:00
										 |  |  | 		/** @type {BuildMeta} */ | 
					
						
							| 
									
										
										
										
											2017-12-06 19:09:17 +08:00
										 |  |  | 		this.buildMeta = undefined; | 
					
						
							| 
									
										
										
										
											2020-12-17 01:26:46 +08:00
										 |  |  | 		/** @type {Record<string, any>} */ | 
					
						
							| 
									
										
										
										
											2017-12-06 19:09:17 +08:00
										 |  |  | 		this.buildInfo = undefined; | 
					
						
							| 
									
										
										
										
											2019-11-08 22:39:44 +08:00
										 |  |  | 		/** @type {Dependency[] | undefined} */ | 
					
						
							|  |  |  | 		this.presentationalDependencies = undefined; | 
					
						
							| 
									
										
										
										
											2016-07-13 17:03:14 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	// TODO remove in webpack 6
 | 
					
						
							|  |  |  | 	// BACKWARD-COMPAT START
 | 
					
						
							| 
									
										
										
										
											2018-08-28 17:56:48 +08:00
										 |  |  | 	get id() { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							|  |  |  | 			"Module.id", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_ID" | 
					
						
							|  |  |  | 		).getModuleId(this); | 
					
						
							| 
									
										
										
										
											2018-08-28 17:56:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	set id(value) { | 
					
						
							| 
									
										
										
										
											2019-09-26 21:51:40 +08:00
										 |  |  | 		if (value === "") { | 
					
						
							|  |  |  | 			this.needId = false; | 
					
						
							|  |  |  | 			return; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		ChunkGraph.getChunkGraphForModule( | 
					
						
							| 
									
										
										
										
											2018-08-28 17:56:48 +08:00
										 |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.id", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_ID" | 
					
						
							|  |  |  | 		).setModuleId(this, value); | 
					
						
							| 
									
										
										
										
											2018-08-28 17:56:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-23 01:23:48 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {string} the hash of the module | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	get hash() { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							|  |  |  | 			"Module.hash", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_HASH" | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 		).getModuleHash(this, undefined); | 
					
						
							| 
									
										
										
										
											2018-08-23 01:23:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {string} the shortened hash of the module | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	get renderedHash() { | 
					
						
							|  |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.renderedHash", | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 			"DEP_WEBPACK_MODULE_RENDERED_HASH" | 
					
						
							|  |  |  | 		).getRenderedModuleHash(this, undefined); | 
					
						
							| 
									
										
										
										
											2018-08-23 01:23:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 20:54:28 +08:00
										 |  |  | 	get profile() { | 
					
						
							|  |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.profile", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_PROFILE" | 
					
						
							| 
									
										
										
										
											2018-08-22 20:54:28 +08:00
										 |  |  | 		).getProfile(this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	set profile(value) { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		ModuleGraph.getModuleGraphForModule( | 
					
						
							| 
									
										
										
										
											2018-08-22 20:54:28 +08:00
										 |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.profile", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_PROFILE" | 
					
						
							|  |  |  | 		).setProfile(this, value); | 
					
						
							| 
									
										
										
										
											2018-08-22 20:54:28 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-21 22:12:00 +08:00
										 |  |  | 	get index() { | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.index", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_INDEX" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).getPreOrderIndex(this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	set index(value) { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		ModuleGraph.getModuleGraphForModule( | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.index", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_INDEX" | 
					
						
							|  |  |  | 		).setPreOrderIndex(this, value); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:12:00 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	get index2() { | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.index2", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_INDEX2" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).getPostOrderIndex(this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	set index2(value) { | 
					
						
							|  |  |  | 		ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.index2", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_INDEX2" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).setPostOrderIndex(this, value); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-22 01:16:02 +08:00
										 |  |  | 	get depth() { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							|  |  |  | 			"Module.depth", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_DEPTH" | 
					
						
							|  |  |  | 		).getDepth(this); | 
					
						
							| 
									
										
										
										
											2018-08-22 01:16:02 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	set depth(value) { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		ModuleGraph.getModuleGraphForModule( | 
					
						
							| 
									
										
										
										
											2018-08-22 01:16:02 +08:00
										 |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.depth", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_DEPTH" | 
					
						
							|  |  |  | 		).setDepth(this, value); | 
					
						
							| 
									
										
										
										
											2018-08-22 01:16:02 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	get issuer() { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							|  |  |  | 			"Module.issuer", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_ISSUER" | 
					
						
							|  |  |  | 		).getIssuer(this); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	set issuer(value) { | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 		ModuleGraph.getModuleGraphForModule( | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.issuer", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_ISSUER" | 
					
						
							|  |  |  | 		).setIssuer(this, value); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	get usedExports() { | 
					
						
							|  |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.usedExports", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_USED_EXPORTS" | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 		).getUsedExports(this, undefined); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-18 03:32:47 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @deprecated | 
					
						
							|  |  |  | 	 * @returns {(string | OptimizationBailoutFunction)[]} list | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	get optimizationBailout() { | 
					
						
							|  |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.optimizationBailout", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_OPTIMIZATION_BAILOUT" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).getOptimizationBailout(this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	get optional() { | 
					
						
							|  |  |  | 		return this.isOptional( | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 				this, | 
					
						
							|  |  |  | 				"Module.optional", | 
					
						
							|  |  |  | 				"DEP_WEBPACK_MODULE_OPTIONAL" | 
					
						
							|  |  |  | 			) | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	addChunk(chunk) { | 
					
						
							| 
									
										
										
										
											2019-11-08 20:21:21 +08:00
										 |  |  | 		const chunkGraph = ChunkGraph.getChunkGraphForModule( | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.addChunk", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_ADD_CHUNK" | 
					
						
							| 
									
										
										
										
											2019-11-08 20:21:21 +08:00
										 |  |  | 		); | 
					
						
							|  |  |  | 		if (chunkGraph.isModuleInChunk(this, chunk)) return false; | 
					
						
							|  |  |  | 		chunkGraph.connectChunkAndModule(chunk, this); | 
					
						
							|  |  |  | 		return true; | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	removeChunk(chunk) { | 
					
						
							|  |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.removeChunk", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_REMOVE_CHUNK" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).disconnectChunkAndModule(chunk, this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	isInChunk(chunk) { | 
					
						
							|  |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.isInChunk", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_IS_IN_CHUNK" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).isModuleInChunk(this, chunk); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	isEntryModule() { | 
					
						
							|  |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.isEntryModule", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_IS_ENTRY_MODULE" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).isEntryModule(this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	getChunks() { | 
					
						
							|  |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.getChunks", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_GET_CHUNKS" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).getModuleChunks(this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	getNumberOfChunks() { | 
					
						
							|  |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.getNumberOfChunks", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_GET_NUMBER_OF_CHUNKS" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).getNumberOfModuleChunks(this); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	get chunksIterable() { | 
					
						
							|  |  |  | 		return ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.chunksIterable", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_CHUNKS_ITERABLE" | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 		).getOrderedModuleChunksIterable(this, compareChunksById); | 
					
						
							| 
									
										
										
										
											2018-08-21 22:12:00 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-12-31 19:51:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {string} exportName a name of an export | 
					
						
							|  |  |  | 	 * @returns {boolean | null} true, if the export is provided why the module. | 
					
						
							| 
									
										
										
										
											2020-03-03 20:37:18 +08:00
										 |  |  | 	 * null, if it's unknown. | 
					
						
							|  |  |  | 	 * false, if it's not provided. | 
					
						
							| 
									
										
										
										
											2018-12-31 19:51:35 +08:00
										 |  |  | 	 */ | 
					
						
							|  |  |  | 	isProvided(exportName) { | 
					
						
							|  |  |  | 		return ModuleGraph.getModuleGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2019-11-15 17:07:41 +08:00
										 |  |  | 			"Module.usedExports", | 
					
						
							|  |  |  | 			"DEP_WEBPACK_MODULE_USED_EXPORTS" | 
					
						
							| 
									
										
										
										
											2018-12-31 19:51:35 +08:00
										 |  |  | 		).isExportProvided(this, exportName); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-08-21 22:15:48 +08:00
										 |  |  | 	// BACKWARD-COMPAT END
 | 
					
						
							| 
									
										
										
										
											2018-08-21 22:12:00 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @deprecated moved to .buildInfo.exportsArgument | 
					
						
							|  |  |  | 	 * @returns {string} name of the exports argument | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2017-12-06 19:09:17 +08:00
										 |  |  | 	get exportsArgument() { | 
					
						
							| 
									
										
										
										
											2018-02-25 09:00:20 +08:00
										 |  |  | 		return (this.buildInfo && this.buildInfo.exportsArgument) || "exports"; | 
					
						
							| 
									
										
										
										
											2017-12-06 19:09:17 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @deprecated moved to .buildInfo.moduleArgument | 
					
						
							|  |  |  | 	 * @returns {string} name of the module argument | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2017-12-06 19:09:17 +08:00
										 |  |  | 	get moduleArgument() { | 
					
						
							| 
									
										
										
										
											2018-02-25 09:00:20 +08:00
										 |  |  | 		return (this.buildInfo && this.buildInfo.moduleArgument) || "module"; | 
					
						
							| 
									
										
										
										
											2017-12-06 19:09:17 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2020-08-18 03:32:47 +08:00
										 |  |  | 	 * @param {ModuleGraph} moduleGraph the module graph | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 	 * @param {boolean} strict the importing module is strict | 
					
						
							| 
									
										
										
										
											2020-04-23 02:31:26 +08:00
										 |  |  | 	 * @returns {"namespace" | "default-only" | "default-with-named" | "dynamic"} export type | 
					
						
							|  |  |  | 	 * "namespace": Exports is already a namespace object. namespace = exports. | 
					
						
							|  |  |  | 	 * "dynamic": Check at runtime if __esModule is set. When set: namespace = { ...exports, default: exports }. When not set: namespace = { default: exports }. | 
					
						
							|  |  |  | 	 * "default-only": Provide a namespace object with only default export. namespace = { default: exports } | 
					
						
							|  |  |  | 	 * "default-with-named": Provide a namespace object with named and default export. namespace = { ...exports, default: exports } | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2020-08-18 03:32:47 +08:00
										 |  |  | 	getExportsType(moduleGraph, strict) { | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 		switch (this.buildMeta && this.buildMeta.exportsType) { | 
					
						
							|  |  |  | 			case "flagged": | 
					
						
							| 
									
										
										
										
											2020-10-30 23:59:35 +08:00
										 |  |  | 				return strict ? "default-with-named" : "namespace"; | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 			case "namespace": | 
					
						
							|  |  |  | 				return "namespace"; | 
					
						
							|  |  |  | 			case "default": | 
					
						
							|  |  |  | 				switch (this.buildMeta.defaultObject) { | 
					
						
							|  |  |  | 					case "redirect": | 
					
						
							| 
									
										
										
										
											2020-10-30 23:59:35 +08:00
										 |  |  | 						return "default-with-named"; | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 					case "redirect-warn": | 
					
						
							|  |  |  | 						return strict ? "default-only" : "default-with-named"; | 
					
						
							|  |  |  | 					default: | 
					
						
							|  |  |  | 						return "default-only"; | 
					
						
							|  |  |  | 				} | 
					
						
							| 
									
										
										
										
											2020-08-18 03:32:47 +08:00
										 |  |  | 			case "dynamic": { | 
					
						
							| 
									
										
										
										
											2020-10-30 23:59:35 +08:00
										 |  |  | 				if (strict) return "default-with-named"; | 
					
						
							| 
									
										
										
										
											2020-08-18 03:32:47 +08:00
										 |  |  | 				// Try to figure out value of __esModule by following reexports
 | 
					
						
							|  |  |  | 				const handleDefault = () => { | 
					
						
							|  |  |  | 					switch (this.buildMeta.defaultObject) { | 
					
						
							|  |  |  | 						case "redirect": | 
					
						
							|  |  |  | 						case "redirect-warn": | 
					
						
							|  |  |  | 							return "default-with-named"; | 
					
						
							|  |  |  | 						default: | 
					
						
							|  |  |  | 							return "default-only"; | 
					
						
							|  |  |  | 					} | 
					
						
							|  |  |  | 				}; | 
					
						
							| 
									
										
										
										
											2020-12-24 03:31:11 +08:00
										 |  |  | 				const exportInfo = moduleGraph.getReadOnlyExportInfo( | 
					
						
							|  |  |  | 					this, | 
					
						
							|  |  |  | 					"__esModule" | 
					
						
							|  |  |  | 				); | 
					
						
							| 
									
										
										
										
											2020-08-18 03:32:47 +08:00
										 |  |  | 				if (exportInfo.provided === false) { | 
					
						
							|  |  |  | 					return handleDefault(); | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				const target = exportInfo.getTarget(moduleGraph); | 
					
						
							|  |  |  | 				if ( | 
					
						
							|  |  |  | 					!target || | 
					
						
							|  |  |  | 					!target.export || | 
					
						
							|  |  |  | 					target.export.length !== 1 || | 
					
						
							|  |  |  | 					target.export[0] !== "__esModule" | 
					
						
							|  |  |  | 				) { | 
					
						
							|  |  |  | 					return "dynamic"; | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				switch ( | 
					
						
							|  |  |  | 					target.module.buildMeta && | 
					
						
							|  |  |  | 					target.module.buildMeta.exportsType | 
					
						
							|  |  |  | 				) { | 
					
						
							|  |  |  | 					case "flagged": | 
					
						
							|  |  |  | 					case "namespace": | 
					
						
							|  |  |  | 						return "namespace"; | 
					
						
							|  |  |  | 					case "default": | 
					
						
							|  |  |  | 						return handleDefault(); | 
					
						
							|  |  |  | 					default: | 
					
						
							|  |  |  | 						return "dynamic"; | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 			default: | 
					
						
							| 
									
										
										
										
											2020-10-30 23:59:35 +08:00
										 |  |  | 				return strict ? "default-with-named" : "dynamic"; | 
					
						
							| 
									
										
										
										
											2019-12-05 05:54:26 +08:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-30 13:40:40 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {Dependency} presentationalDependency dependency being tied to module. | 
					
						
							|  |  |  | 	 * This is a Dependency without edge in the module graph. It's only for presentation. | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	addPresentationalDependency(presentationalDependency) { | 
					
						
							| 
									
										
										
										
											2019-11-08 22:39:44 +08:00
										 |  |  | 		if (this.presentationalDependencies === undefined) { | 
					
						
							|  |  |  | 			this.presentationalDependencies = []; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2019-10-30 13:40:40 +08:00
										 |  |  | 		this.presentationalDependencies.push(presentationalDependency); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-08 22:39:44 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * Removes all dependencies and blocks | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	clearDependenciesAndBlocks() { | 
					
						
							|  |  |  | 		if (this.presentationalDependencies !== undefined) { | 
					
						
							|  |  |  | 			this.presentationalDependencies.length = 0; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		super.clearDependenciesAndBlocks(); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {WebpackError} warning the warning | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	addWarning(warning) { | 
					
						
							|  |  |  | 		if (this._warnings === undefined) { | 
					
						
							|  |  |  | 			this._warnings = []; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		this._warnings.push(warning); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {Iterable<WebpackError> | undefined} list of warnings if any | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	getWarnings() { | 
					
						
							|  |  |  | 		return this._warnings; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-07 22:38:57 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {number} number of warnings | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	getNumberOfWarnings() { | 
					
						
							|  |  |  | 		return this._warnings !== undefined ? this._warnings.length : 0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {WebpackError} error the error | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	addError(error) { | 
					
						
							|  |  |  | 		if (this._errors === undefined) { | 
					
						
							|  |  |  | 			this._errors = []; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		this._errors.push(error); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {Iterable<WebpackError> | undefined} list of errors if any | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	getErrors() { | 
					
						
							|  |  |  | 		return this._errors; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-07-07 22:38:57 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {number} number of errors | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	getNumberOfErrors() { | 
					
						
							|  |  |  | 		return this._errors !== undefined ? this._errors.length : 0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * removes all warnings and errors | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	clearWarningsAndErrors() { | 
					
						
							|  |  |  | 		if (this._warnings !== undefined) { | 
					
						
							|  |  |  | 			this._warnings.length = 0; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		if (this._errors !== undefined) { | 
					
						
							|  |  |  | 			this._errors.length = 0; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2018-07-24 23:35:36 +08:00
										 |  |  | 	 * @param {ModuleGraph} moduleGraph the module graph | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	 * @returns {boolean} true, if the module is optional | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-07-24 23:35:36 +08:00
										 |  |  | 	isOptional(moduleGraph) { | 
					
						
							| 
									
										
										
										
											2019-11-08 05:12:31 +08:00
										 |  |  | 		let hasConnections = false; | 
					
						
							|  |  |  | 		for (const r of moduleGraph.getIncomingConnections(this)) { | 
					
						
							| 
									
										
										
										
											2020-10-07 15:10:29 +08:00
										 |  |  | 			if ( | 
					
						
							|  |  |  | 				!r.dependency || | 
					
						
							|  |  |  | 				!r.dependency.optional || | 
					
						
							|  |  |  | 				!r.isTargetActive(undefined) | 
					
						
							|  |  |  | 			) { | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 				return false; | 
					
						
							| 
									
										
										
										
											2020-10-07 15:10:29 +08:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2019-11-08 05:12:31 +08:00
										 |  |  | 			hasConnections = true; | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		return hasConnections; | 
					
						
							| 
									
										
										
										
											2017-11-06 20:02:35 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-02 22:18:49 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 	 * @param {ChunkGraph} chunkGraph the chunk graph | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	 * @param {Chunk} chunk a chunk | 
					
						
							|  |  |  | 	 * @param {Chunk=} ignoreChunk chunk to be ignored | 
					
						
							|  |  |  | 	 * @returns {boolean} true, if the module is accessible from "chunk" when ignoring "ignoreChunk" | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 	isAccessibleInChunk(chunkGraph, chunk, ignoreChunk) { | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 		// Check if module is accessible in ALL chunk groups
 | 
					
						
							|  |  |  | 		for (const chunkGroup of chunk.groupsIterable) { | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 			if (!this.isAccessibleInChunkGroup(chunkGraph, chunkGroup)) return false; | 
					
						
							| 
									
										
										
										
											2014-09-08 04:54:38 +08:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 		return true; | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-05-17 06:31:52 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 	 * @param {ChunkGraph} chunkGraph the chunk graph | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	 * @param {ChunkGroup} chunkGroup a chunk group | 
					
						
							|  |  |  | 	 * @param {Chunk=} ignoreChunk chunk to be ignored | 
					
						
							|  |  |  | 	 * @returns {boolean} true, if the module is accessible from "chunkGroup" when ignoring "ignoreChunk" | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 	isAccessibleInChunkGroup(chunkGraph, chunkGroup, ignoreChunk) { | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 		const queue = new Set([chunkGroup]); | 
					
						
							| 
									
										
										
										
											2017-11-06 20:02:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 		// Check if module is accessible from all items of the queue
 | 
					
						
							|  |  |  | 		queueFor: for (const cg of queue) { | 
					
						
							|  |  |  | 			// 1. If module is in one of the chunks of the group we can continue checking the next items
 | 
					
						
							|  |  |  | 			//    because it's accessible.
 | 
					
						
							|  |  |  | 			for (const chunk of cg.chunks) { | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 				if (chunk !== ignoreChunk && chunkGraph.isModuleInChunk(this, chunk)) | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 					continue queueFor; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			// 2. If the chunk group is initial, we can break here because it's not accessible.
 | 
					
						
							|  |  |  | 			if (chunkGroup.isInitial()) return false; | 
					
						
							|  |  |  | 			// 3. Enqueue all parents because it must be accessible from ALL parents
 | 
					
						
							|  |  |  | 			for (const parent of chunkGroup.parentsIterable) queue.add(parent); | 
					
						
							| 
									
										
										
										
											2018-05-29 20:50:40 +08:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 		// When we processed through the whole list and we didn't bailout, the module is accessible
 | 
					
						
							|  |  |  | 		return true; | 
					
						
							| 
									
										
										
										
											2017-11-25 00:22:58 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {Chunk} chunk a chunk | 
					
						
							| 
									
										
										
										
											2018-07-24 23:35:36 +08:00
										 |  |  | 	 * @param {ModuleGraph} moduleGraph the module graph | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 	 * @param {ChunkGraph} chunkGraph the chunk graph | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	 * @returns {boolean} true, if the module has any reason why "chunk" should be included | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 	hasReasonForChunk(chunk, moduleGraph, chunkGraph) { | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 		// check for each reason if we need the chunk
 | 
					
						
							| 
									
										
										
										
											2021-02-23 17:59:59 +08:00
										 |  |  | 		for (const [ | 
					
						
							|  |  |  | 			fromModule, | 
					
						
							|  |  |  | 			connections | 
					
						
							|  |  |  | 		] of moduleGraph.getIncomingConnectionsByOriginModule(this)) { | 
					
						
							|  |  |  | 			if (!connections.some(c => c.isTargetActive(chunk.runtime))) continue; | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 			for (const originChunk of chunkGraph.getModuleChunksIterable( | 
					
						
							|  |  |  | 				fromModule | 
					
						
							|  |  |  | 			)) { | 
					
						
							| 
									
										
										
										
											2020-03-13 00:51:26 +08:00
										 |  |  | 				// return true if module this is not reachable from originChunk when ignoring chunk
 | 
					
						
							| 
									
										
										
										
											2018-08-14 17:18:22 +08:00
										 |  |  | 				if (!this.isAccessibleInChunk(chunkGraph, originChunk, chunk)) | 
					
						
							|  |  |  | 					return true; | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2017-06-14 00:58:14 +08:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2018-01-22 19:34:34 +08:00
										 |  |  | 		return false; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2018-07-24 23:35:36 +08:00
										 |  |  | 	 * @param {ModuleGraph} moduleGraph the module graph | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 	 * @param {RuntimeSpec} runtime the runtime | 
					
						
							| 
									
										
										
										
											2018-07-24 23:35:36 +08:00
										 |  |  | 	 * @returns {boolean} true if at least one other module depends on this module | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 	hasReasons(moduleGraph, runtime) { | 
					
						
							| 
									
										
										
										
											2019-11-08 05:12:31 +08:00
										 |  |  | 		for (const c of moduleGraph.getIncomingConnections(this)) { | 
					
						
							| 
									
										
										
										
											2020-10-07 15:10:29 +08:00
										 |  |  | 			if (c.isTargetActive(runtime)) return true; | 
					
						
							| 
									
										
										
										
											2019-11-08 05:12:31 +08:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		return false; | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2016-07-13 17:03:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {string} for debugging | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 	toString() { | 
					
						
							| 
									
										
										
										
											2018-08-28 17:50:33 +08:00
										 |  |  | 		return `Module[${this.debugId}: ${this.identifier()}]`; | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2018-09-26 15:14:44 +08:00
										 |  |  | 	 * @param {NeedBuildContext} context context info | 
					
						
							|  |  |  | 	 * @param {function(WebpackError=, boolean=): void} callback callback function, returns true, if the module needs a rebuild | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-09-26 15:14:44 +08:00
										 |  |  | 	needBuild(context, callback) { | 
					
						
							|  |  |  | 		callback( | 
					
						
							|  |  |  | 			null, | 
					
						
							|  |  |  | 			!this.buildMeta || | 
					
						
							| 
									
										
										
										
											2018-09-27 13:22:19 +08:00
										 |  |  | 				this.needRebuild === Module.prototype.needRebuild || | 
					
						
							| 
									
										
										
										
											2020-09-15 20:33:50 +08:00
										 |  |  | 				deprecatedNeedRebuild(this, context) | 
					
						
							| 
									
										
										
										
											2018-09-12 00:47:55 +08:00
										 |  |  | 		); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @deprecated Use needBuild instead | 
					
						
							| 
									
										
										
										
											2020-08-03 02:09:36 +08:00
										 |  |  | 	 * @param {Map<string, number|null>} fileTimestamps timestamps of files | 
					
						
							|  |  |  | 	 * @param {Map<string, number|null>} contextTimestamps timestamps of directories | 
					
						
							| 
									
										
										
										
											2018-09-12 00:47:55 +08:00
										 |  |  | 	 * @returns {boolean} true, if the module needs a rebuild | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 	needRebuild(fileTimestamps, contextTimestamps) { | 
					
						
							|  |  |  | 		return true; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-21 00:17:51 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {Hash} hash the hash used to track dependencies | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 	 * @param {UpdateHashContext} context context | 
					
						
							| 
									
										
										
										
											2018-07-21 00:17:51 +08:00
										 |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2019-09-26 21:51:40 +08:00
										 |  |  | 	updateHash( | 
					
						
							|  |  |  | 		hash, | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 		context = { | 
					
						
							|  |  |  | 			chunkGraph: ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 				this, | 
					
						
							|  |  |  | 				"Module.updateHash", | 
					
						
							|  |  |  | 				"DEP_WEBPACK_MODULE_UPDATE_HASH" | 
					
						
							|  |  |  | 			), | 
					
						
							|  |  |  | 			runtime: undefined | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2019-09-26 21:51:40 +08:00
										 |  |  | 	) { | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 		const { chunkGraph, runtime } = context; | 
					
						
							| 
									
										
										
										
											2021-01-25 00:14:13 +08:00
										 |  |  | 		hash.update(chunkGraph.getModuleGraphHash(this, runtime)); | 
					
						
							| 
									
										
										
										
											2019-11-08 22:39:44 +08:00
										 |  |  | 		if (this.presentationalDependencies !== undefined) { | 
					
						
							|  |  |  | 			for (const dep of this.presentationalDependencies) { | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 				dep.updateHash(hash, context); | 
					
						
							| 
									
										
										
										
											2019-11-08 22:39:44 +08:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2019-10-30 13:40:40 +08:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 		super.updateHash(hash, context); | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2016-12-05 06:47:19 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:38:34 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-09-12 00:47:55 +08:00
										 |  |  | 	invalidateBuild() { | 
					
						
							| 
									
										
										
										
											2020-03-10 09:59:46 +08:00
										 |  |  | 		// should be overridden to support this feature
 | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 	/* istanbul ignore next */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @abstract | 
					
						
							|  |  |  | 	 * @returns {string} a unique identifier of the module | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	identifier() { | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 		const AbstractMethodError = require("./AbstractMethodError"); | 
					
						
							| 
									
										
										
										
											2019-09-28 01:50:23 +08:00
										 |  |  | 		throw new AbstractMethodError(); | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 	/* istanbul ignore next */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @abstract | 
					
						
							|  |  |  | 	 * @param {RequestShortener} requestShortener the request shortener | 
					
						
							|  |  |  | 	 * @returns {string} a user readable identifier of the module | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	readableIdentifier(requestShortener) { | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 		const AbstractMethodError = require("./AbstractMethodError"); | 
					
						
							| 
									
										
										
										
											2019-09-28 01:50:23 +08:00
										 |  |  | 		throw new AbstractMethodError(); | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 	/* istanbul ignore next */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @abstract | 
					
						
							| 
									
										
										
										
											2019-11-11 22:25:03 +08:00
										 |  |  | 	 * @param {WebpackOptions} options webpack options | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	 * @param {Compilation} compilation the compilation | 
					
						
							| 
									
										
										
										
											2019-11-11 22:25:03 +08:00
										 |  |  | 	 * @param {ResolverWithOptions} resolver the resolver | 
					
						
							|  |  |  | 	 * @param {InputFileSystem} fs the file system | 
					
						
							| 
									
										
										
										
											2018-09-12 00:47:55 +08:00
										 |  |  | 	 * @param {function(WebpackError=): void} callback callback function | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	build(options, compilation, resolver, fs, callback) { | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 		const AbstractMethodError = require("./AbstractMethodError"); | 
					
						
							| 
									
										
										
										
											2019-09-28 01:50:23 +08:00
										 |  |  | 		throw new AbstractMethodError(); | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-03 22:00:32 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @abstract | 
					
						
							| 
									
										
										
										
											2020-03-10 09:59:46 +08:00
										 |  |  | 	 * @returns {Set<string>} types available (do not mutate) | 
					
						
							| 
									
										
										
										
											2018-12-03 22:00:32 +08:00
										 |  |  | 	 */ | 
					
						
							|  |  |  | 	getSourceTypes() { | 
					
						
							| 
									
										
										
										
											2019-09-26 21:51:40 +08:00
										 |  |  | 		// Better override this method to return the correct types
 | 
					
						
							|  |  |  | 		if (this.source === Module.prototype.source) { | 
					
						
							|  |  |  | 			return DEFAULT_TYPES_UNKNOWN; | 
					
						
							|  |  |  | 		} else { | 
					
						
							|  |  |  | 			return DEFAULT_TYPES_JS; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2018-12-03 22:00:32 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @abstract | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | 	 * @deprecated Use codeGeneration() instead | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 	 * @param {DependencyTemplates} dependencyTemplates the dependency templates | 
					
						
							|  |  |  | 	 * @param {RuntimeTemplate} runtimeTemplate the runtime template | 
					
						
							|  |  |  | 	 * @param {string=} type the type of source that should be generated | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	 * @returns {Source} generated source | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 	source(dependencyTemplates, runtimeTemplate, type = "javascript") { | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | 		if (this.codeGeneration === Module.prototype.codeGeneration) { | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 			const AbstractMethodError = require("./AbstractMethodError"); | 
					
						
							| 
									
										
										
										
											2019-09-28 01:50:23 +08:00
										 |  |  | 			throw new AbstractMethodError(); | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 		const chunkGraph = ChunkGraph.getChunkGraphForModule( | 
					
						
							|  |  |  | 			this, | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 			"Module.source() is deprecated. Use Compilation.codeGenerationResults.getSource(module, runtime, type) instead", | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 			"DEP_WEBPACK_MODULE_SOURCE" | 
					
						
							|  |  |  | 		); | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 		/** @type {CodeGenerationContext} */ | 
					
						
							|  |  |  | 		const codeGenContext = { | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 			dependencyTemplates, | 
					
						
							|  |  |  | 			runtimeTemplate, | 
					
						
							|  |  |  | 			moduleGraph: chunkGraph.moduleGraph, | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 			chunkGraph, | 
					
						
							|  |  |  | 			runtime: undefined | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 		}; | 
					
						
							| 
									
										
										
										
											2020-07-28 00:09:48 +08:00
										 |  |  | 		const sources = this.codeGeneration(codeGenContext).sources; | 
					
						
							| 
									
										
										
										
											2021-02-04 21:21:27 +08:00
										 |  |  | 		return type ? sources.get(type) : sources.get(first(this.getSourceTypes())); | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 	/* istanbul ignore next */ | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @abstract | 
					
						
							| 
									
										
										
										
											2018-12-04 18:23:40 +08:00
										 |  |  | 	 * @param {string=} type the source type for which the size should be estimated | 
					
						
							| 
									
										
										
										
											2019-05-13 18:29:29 +08:00
										 |  |  | 	 * @returns {number} the estimated size of the module (must be non-zero) | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-12-04 18:23:40 +08:00
										 |  |  | 	size(type) { | 
					
						
							| 
									
										
										
										
											2020-04-16 15:37:11 +08:00
										 |  |  | 		const AbstractMethodError = require("./AbstractMethodError"); | 
					
						
							| 
									
										
										
										
											2019-09-28 01:50:23 +08:00
										 |  |  | 		throw new AbstractMethodError(); | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-06-06 22:37:23 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-20 22:24:35 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {LibIdentOptions} options options | 
					
						
							|  |  |  | 	 * @returns {string | null} an identifier for library inclusion | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	libIdent(options) { | 
					
						
							|  |  |  | 		return null; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {string | null} absolute path which should be used for condition matching (usually the resource path) | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	nameForCondition() { | 
					
						
							|  |  |  | 		return null; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-06-06 22:37:23 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-09-12 04:37:57 +08:00
										 |  |  | 	/** | 
					
						
							| 
									
										
										
										
											2020-09-15 16:07:04 +08:00
										 |  |  | 	 * @param {ConcatenationBailoutReasonContext} context context | 
					
						
							| 
									
										
										
										
											2020-09-12 04:37:57 +08:00
										 |  |  | 	 * @returns {string | undefined} reason why this module can't be concatenated, undefined when it can be concatenated | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2020-09-15 16:07:04 +08:00
										 |  |  | 	getConcatenationBailoutReason(context) { | 
					
						
							| 
									
										
										
										
											2020-09-12 04:37:57 +08:00
										 |  |  | 		return `Module Concatenation is not implemented for ${this.constructor.name}`; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-10-05 22:57:31 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {ModuleGraph} moduleGraph the module graph | 
					
						
							|  |  |  | 	 * @returns {ConnectionState} how this module should be connected to referencing modules when consumed for side-effects only | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	getSideEffectsConnectionState(moduleGraph) { | 
					
						
							|  |  |  | 		return true; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {CodeGenerationContext} context context for code generation | 
					
						
							|  |  |  | 	 * @returns {CodeGenerationResult} result | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	codeGeneration(context) { | 
					
						
							|  |  |  | 		// Best override this method
 | 
					
						
							|  |  |  | 		const sources = new Map(); | 
					
						
							|  |  |  | 		for (const type of this.getSourceTypes()) { | 
					
						
							|  |  |  | 			if (type !== "unknown") { | 
					
						
							|  |  |  | 				sources.set( | 
					
						
							|  |  |  | 					type, | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 					this.source( | 
					
						
							|  |  |  | 						context.dependencyTemplates, | 
					
						
							|  |  |  | 						context.runtimeTemplate, | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | 						type | 
					
						
							| 
									
										
										
										
											2020-07-02 23:03:45 +08:00
										 |  |  | 					) | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | 				); | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 		return { | 
					
						
							|  |  |  | 			sources, | 
					
						
							| 
									
										
										
										
											2020-07-28 01:36:06 +08:00
										 |  |  | 			runtimeRequirements: new Set([ | 
					
						
							|  |  |  | 				RuntimeGlobals.module, | 
					
						
							|  |  |  | 				RuntimeGlobals.exports, | 
					
						
							|  |  |  | 				RuntimeGlobals.require | 
					
						
							|  |  |  | 			]) | 
					
						
							| 
									
										
										
										
											2019-10-09 04:29:46 +08:00
										 |  |  | 		}; | 
					
						
							| 
									
										
										
										
											2018-11-06 02:03:12 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {Chunk} chunk the chunk which condition should be checked | 
					
						
							| 
									
										
										
										
											2018-08-14 22:40:37 +08:00
										 |  |  | 	 * @param {Compilation} compilation the compilation | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	 * @returns {boolean} true, if the chunk is ok for the module | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2018-08-14 22:40:37 +08:00
										 |  |  | 	chunkCondition(chunk, compilation) { | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 		return true; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * Assuming this module is in the cache. Update the (cached) module with | 
					
						
							|  |  |  | 	 * the fresh module from the factory. Usually updates internal references | 
					
						
							|  |  |  | 	 * and properties. | 
					
						
							|  |  |  | 	 * @param {Module} module fresh module | 
					
						
							|  |  |  | 	 * @returns {void} | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	updateCacheModule(module) { | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		this.type = module.type; | 
					
						
							| 
									
										
										
										
											2021-01-08 21:50:15 +08:00
										 |  |  | 		this.layer = module.layer; | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		this.context = module.context; | 
					
						
							|  |  |  | 		this.factoryMeta = module.factoryMeta; | 
					
						
							|  |  |  | 		this.resolveOptions = module.resolveOptions; | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-07-25 18:20:35 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/** | 
					
						
							|  |  |  | 	 * @returns {Source | null} the original source for the module before webpack transformation | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	originalSource() { | 
					
						
							|  |  |  | 		return null; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-23 03:54:34 +08:00
										 |  |  | 	/** | 
					
						
							|  |  |  | 	 * @param {LazySet<string>} fileDependencies set where file dependencies are added to | 
					
						
							|  |  |  | 	 * @param {LazySet<string>} contextDependencies set where context dependencies are added to | 
					
						
							|  |  |  | 	 * @param {LazySet<string>} missingDependencies set where missing dependencies are added to | 
					
						
							|  |  |  | 	 * @param {LazySet<string>} buildDependencies set where build dependencies are added to | 
					
						
							|  |  |  | 	 */ | 
					
						
							|  |  |  | 	addCacheDependencies( | 
					
						
							|  |  |  | 		fileDependencies, | 
					
						
							|  |  |  | 		contextDependencies, | 
					
						
							|  |  |  | 		missingDependencies, | 
					
						
							|  |  |  | 		buildDependencies | 
					
						
							|  |  |  | 	) {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 	serialize(context) { | 
					
						
							|  |  |  | 		const { write } = context; | 
					
						
							|  |  |  | 		write(this.type); | 
					
						
							| 
									
										
										
										
											2020-12-22 21:51:09 +08:00
										 |  |  | 		write(this.layer); | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		write(this.context); | 
					
						
							|  |  |  | 		write(this.resolveOptions); | 
					
						
							|  |  |  | 		write(this.factoryMeta); | 
					
						
							|  |  |  | 		write(this.useSourceMap); | 
					
						
							| 
									
										
										
										
											2020-10-26 21:41:46 +08:00
										 |  |  | 		write(this.useSimpleSourceMap); | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 		write( | 
					
						
							|  |  |  | 			this._warnings !== undefined && this._warnings.length === 0 | 
					
						
							|  |  |  | 				? undefined | 
					
						
							|  |  |  | 				: this._warnings | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 		write( | 
					
						
							|  |  |  | 			this._errors !== undefined && this._errors.length === 0 | 
					
						
							|  |  |  | 				? undefined | 
					
						
							|  |  |  | 				: this._errors | 
					
						
							|  |  |  | 		); | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		write(this.buildMeta); | 
					
						
							|  |  |  | 		write(this.buildInfo); | 
					
						
							| 
									
										
										
										
											2019-10-30 13:40:40 +08:00
										 |  |  | 		write(this.presentationalDependencies); | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		super.serialize(context); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	deserialize(context) { | 
					
						
							|  |  |  | 		const { read } = context; | 
					
						
							|  |  |  | 		this.type = read(); | 
					
						
							| 
									
										
										
										
											2020-12-22 21:51:09 +08:00
										 |  |  | 		this.layer = read(); | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		this.context = read(); | 
					
						
							|  |  |  | 		this.resolveOptions = read(); | 
					
						
							|  |  |  | 		this.factoryMeta = read(); | 
					
						
							|  |  |  | 		this.useSourceMap = read(); | 
					
						
							| 
									
										
										
										
											2020-10-26 21:41:46 +08:00
										 |  |  | 		this.useSimpleSourceMap = read(); | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 		this._warnings = read(); | 
					
						
							|  |  |  | 		this._errors = read(); | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		this.buildMeta = read(); | 
					
						
							|  |  |  | 		this.buildInfo = read(); | 
					
						
							| 
									
										
										
										
											2019-10-30 13:40:40 +08:00
										 |  |  | 		this.presentationalDependencies = read(); | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | 		super.deserialize(context); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-07-25 18:12:17 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-09 20:30:59 +08:00
										 |  |  | makeSerializable(Module, "webpack/lib/Module"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-15 19:17:36 +08:00
										 |  |  | // TODO remove in webpack 6
 | 
					
						
							| 
									
										
										
										
											2018-08-08 22:29:15 +08:00
										 |  |  | Object.defineProperty(Module.prototype, "hasEqualsChunks", { | 
					
						
							|  |  |  | 	get() { | 
					
						
							|  |  |  | 		throw new Error( | 
					
						
							|  |  |  | 			"Module.hasEqualsChunks was renamed (use hasEqualChunks instead)" | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-15 19:17:36 +08:00
										 |  |  | // TODO remove in webpack 6
 | 
					
						
							| 
									
										
										
										
											2018-08-07 03:01:46 +08:00
										 |  |  | Object.defineProperty(Module.prototype, "isUsed", { | 
					
						
							|  |  |  | 	get() { | 
					
						
							|  |  |  | 		throw new Error( | 
					
						
							|  |  |  | 			"Module.isUsed was renamed (use getUsedName, isExportUsed or isModuleUsed instead)" | 
					
						
							|  |  |  | 		); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | // TODO remove in webpack 6
 | 
					
						
							|  |  |  | Object.defineProperty(Module.prototype, "errors", { | 
					
						
							|  |  |  | 	get: util.deprecate( | 
					
						
							|  |  |  | 		/** | 
					
						
							|  |  |  | 		 * @this {Module} | 
					
						
							|  |  |  | 		 * @returns {WebpackError[]} array | 
					
						
							|  |  |  | 		 */ | 
					
						
							| 
									
										
										
										
											2020-03-29 06:10:15 +08:00
										 |  |  | 		function () { | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 			if (this._errors === undefined) { | 
					
						
							|  |  |  | 				this._errors = []; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			return this._errors; | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		"Module.errors was removed (use getErrors instead)", | 
					
						
							|  |  |  | 		"DEP_WEBPACK_MODULE_ERRORS" | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // TODO remove in webpack 6
 | 
					
						
							|  |  |  | Object.defineProperty(Module.prototype, "warnings", { | 
					
						
							|  |  |  | 	get: util.deprecate( | 
					
						
							|  |  |  | 		/** | 
					
						
							|  |  |  | 		 * @this {Module} | 
					
						
							|  |  |  | 		 * @returns {WebpackError[]} array | 
					
						
							|  |  |  | 		 */ | 
					
						
							| 
									
										
										
										
											2020-03-29 06:10:15 +08:00
										 |  |  | 		function () { | 
					
						
							| 
									
										
										
										
											2019-11-08 19:43:05 +08:00
										 |  |  | 			if (this._warnings === undefined) { | 
					
						
							|  |  |  | 				this._warnings = []; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			return this._warnings; | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		"Module.warnings was removed (use getWarnings instead)", | 
					
						
							|  |  |  | 		"DEP_WEBPACK_MODULE_WARNINGS" | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-15 19:17:36 +08:00
										 |  |  | // TODO remove in webpack 6
 | 
					
						
							| 
									
										
										
										
											2018-08-07 03:01:46 +08:00
										 |  |  | Object.defineProperty(Module.prototype, "used", { | 
					
						
							|  |  |  | 	get() { | 
					
						
							| 
									
										
										
										
											2018-08-16 19:55:41 +08:00
										 |  |  | 		throw new Error( | 
					
						
							|  |  |  | 			"Module.used was refactored (use ModuleGraph.getUsedExports instead)" | 
					
						
							|  |  |  | 		); | 
					
						
							| 
									
										
										
										
											2018-08-07 03:01:46 +08:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 	set(value) { | 
					
						
							| 
									
										
										
										
											2018-08-16 19:55:41 +08:00
										 |  |  | 		throw new Error( | 
					
						
							|  |  |  | 			"Module.used was refactored (use ModuleGraph.setUsedExports instead)" | 
					
						
							|  |  |  | 		); | 
					
						
							| 
									
										
										
										
											2018-08-07 03:01:46 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-04 05:22:23 +08:00
										 |  |  | module.exports = Module; |