/
var
/
www
/
cobraambalaj
/
node_modules
/
webpack
/
lib
/
/var/www/cobraambalaj/node_modules/webpack/lib
mkdir
upload
Name
Size
Mode
Actions
asset/
-
0755
rm
async-modules/
-
0755
rm
cache/
-
0755
rm
config/
-
0755
rm
container/
-
0755
rm
debug/
-
0755
rm
dependencies/
-
0755
rm
electron/
-
0755
rm
errors/
-
0755
rm
hmr/
-
0755
rm
ids/
-
0755
rm
javascript/
-
0755
rm
json/
-
0755
rm
library/
-
0755
rm
logging/
-
0755
rm
node/
-
0755
rm
optimize/
-
0755
rm
performance/
-
0755
rm
prefetch/
-
0755
rm
rules/
-
0755
rm
runtime/
-
0755
rm
schemes/
-
0755
rm
serialization/
-
0755
rm
sharing/
-
0755
rm
stats/
-
0755
rm
util/
-
0755
rm
wasm/
-
0755
rm
wasm-async/
-
0755
rm
wasm-sync/
-
0755
rm
web/
-
0755
rm
webworker/
-
0755
rm
AbstractMethodError.js
1133
0644
edit
dl
rm
APIPlugin.js
5719
0644
edit
dl
rm
AsyncDependenciesBlock.js
2733
0644
edit
dl
rm
AsyncDependencyToInitialChunkError.js
965
0644
edit
dl
rm
AutomaticPrefetchPlugin.js
1491
0644
edit
dl
rm
BannerPlugin.js
2647
0644
edit
dl
rm
buildChunkGraph.js
42904
0644
edit
dl
rm
Cache.js
3967
0644
edit
dl
rm
CacheFacade.js
8433
0644
edit
dl
rm
CaseSensitiveModulesWarning.js
2146
0644
edit
dl
rm
Chunk.js
20042
0644
edit
dl
rm
ChunkGraph.js
46071
0644
edit
dl
rm
ChunkGroup.js
15121
0644
edit
dl
rm
ChunkRenderError.js
709
0644
edit
dl
rm
ChunkTemplate.js
3992
0644
edit
dl
rm
CleanPlugin.js
9940
0644
edit
dl
rm
cli.js
15603
0644
edit
dl
rm
CodeGenerationError.js
671
0644
edit
dl
rm
CodeGenerationResults.js
4266
0644
edit
dl
rm
CommentCompilationWarning.js
781
0644
edit
dl
rm
CompatibilityPlugin.js
4181
0644
edit
dl
rm
Compilation.js
122013
0644
edit
dl
rm
Compiler.js
31643
0644
edit
dl
rm
ConcatenationScope.js
4635
0644
edit
dl
rm
ConcurrentCompilationError.js
493
0644
edit
dl
rm
ConditionalInitFragment.js
3537
0644
edit
dl
rm
ConstPlugin.js
14769
0644
edit
dl
rm
ContextExclusionPlugin.js
797
0644
edit
dl
rm
ContextModule.js
32171
0644
edit
dl
rm
ContextModuleFactory.js
11089
0644
edit
dl
rm
ContextReplacementPlugin.js
4711
0644
edit
dl
rm
DefinePlugin.js
9970
0644
edit
dl
rm
DelegatedModule.js
7043
0644
edit
dl
rm
DelegatedModuleFactoryPlugin.js
2337
0644
edit
dl
rm
DelegatedPlugin.js
1015
0644
edit
dl
rm
DependenciesBlock.js
2379
0644
edit
dl
rm
Dependency.js
6694
0644
edit
dl
rm
DependencyTemplate.js
1990
0644
edit
dl
rm
DependencyTemplates.js
1527
0644
edit
dl
rm
DllEntryPlugin.js
1277
0644
edit
dl
rm
DllModule.js
4313
0644
edit
dl
rm
DllModuleFactory.js
1008
0644
edit
dl
rm
DllPlugin.js
1597
0644
edit
dl
rm
DllReferencePlugin.js
5070
0644
edit
dl
rm
DynamicEntryPlugin.js
2035
0644
edit
dl
rm
EntryOptionPlugin.js
2747
0644
edit
dl
rm
EntryPlugin.js
1738
0644
edit
dl
rm
Entrypoint.js
3025
0644
edit
dl
rm
EnvironmentPlugin.js
1743
0644
edit
dl
rm
ErrorHelpers.js
1454
0644
edit
dl
rm
EvalDevToolModulePlugin.js
3235
0644
edit
dl
rm
EvalSourceMapDevToolPlugin.js
6239
0644
edit
dl
rm
ExportsInfo.js
42660
0644
edit
dl
rm
ExportsInfoApiPlugin.js
2072
0644
edit
dl
rm
ExternalModule.js
14840
0644
edit
dl
rm
ExternalModuleFactoryPlugin.js
7205
0644
edit
dl
rm
ExternalsPlugin.js
899
0644
edit
dl
rm
FileSystemInfo.js
81514
0644
edit
dl
rm
FlagAllModulesAsUsedPlugin.js
1451
0644
edit
dl
rm
FlagDependencyExportsPlugin.js
11603
0644
edit
dl
rm
FlagDependencyUsagePlugin.js
10780
0644
edit
dl
rm
FlagEntryExportAsUsedPlugin.js
1373
0644
edit
dl
rm
formatLocation.js
1781
0644
edit
dl
rm
Generator.js
4571
0644
edit
dl
rm
GraphHelpers.js
1074
0644
edit
dl
rm
HarmonyLinkingError.js
409
0644
edit
dl
rm
HookWebpackError.js
2121
0644
edit
dl
rm
HotModuleReplacementPlugin.js
25526
0644
edit
dl
rm
HotUpdateChunk.js
353
0644
edit
dl
rm
IgnoreErrorModuleFactory.js
1048
0644
edit
dl
rm
IgnorePlugin.js
2144
0644
edit
dl
rm
IgnoreWarningsPlugin.js
964
0644
edit
dl
rm
index.js
14063
0644
edit
dl
rm
InitFragment.js
3659
0644
edit
dl
rm
InvalidDependenciesModuleWarning.js
1926
0644
edit
dl
rm
JavascriptMetaInfoPlugin.js
1885
0644
edit
dl
rm
LibManifestPlugin.js
3116
0644
edit
dl
rm
LibraryTemplatePlugin.js
1588
0644
edit
dl
rm
LoaderOptionsPlugin.js
1743
0644
edit
dl
rm
LoaderTargetPlugin.js
747
0644
edit
dl
rm
MainTemplate.js
10377
0644
edit
dl
rm
Module.js
28536
0644
edit
dl
rm
ModuleBuildError.js
1678
0644
edit
dl
rm
ModuleDependencyError.js
1159
0644
edit
dl
rm
ModuleDependencyWarning.js
1274
0644
edit
dl
rm
ModuleError.js
1254
0644
edit
dl
rm
ModuleFactory.js
1363
0644
edit
dl
rm
ModuleFilenameHelpers.js
7430
0644
edit
dl
rm
ModuleGraph.js
21886
0644
edit
dl
rm
ModuleGraphConnection.js
5203
0644
edit
dl
rm
ModuleInfoHeaderPlugin.js
7182
0644
edit
dl
rm
ModuleNotFoundError.js
2662
0644
edit
dl
rm
ModuleParseError.js
3384
0644
edit
dl
rm
ModuleProfile.js
2440
0644
edit
dl
rm
ModuleRestoreError.js
1009
0644
edit
dl
rm
ModuleStoreError.js
1003
0644
edit
dl
rm
ModuleTemplate.js
4337
0644
edit
dl
rm
ModuleWarning.js
1332
0644
edit
dl
rm
MultiCompiler.js
14470
0644
edit
dl
rm
MultiStats.js
4222
0644
edit
dl
rm
MultiWatching.js
1466
0644
edit
dl
rm
NodeStuffPlugin.js
4016
0644
edit
dl
rm
NoEmitOnErrorsPlugin.js
713
0644
edit
dl
rm
NoModeWarning.js
715
0644
edit
dl
rm
NormalModule.js
34324
0644
edit
dl
rm
NormalModuleFactory.js
29122
0644
edit
dl
rm
NormalModuleReplacementPlugin.js
1883
0644
edit
dl
rm
NullFactory.js
628
0644
edit
dl
rm
OptimizationStages.js
204
0644
edit
dl
rm
OptionsApply.js
201
0644
edit
dl
rm
Parser.js
930
0644
edit
dl
rm
PrefetchPlugin.js
1048
0644
edit
dl
rm
ProgressPlugin.js
17145
0644
edit
dl
rm
ProvidePlugin.js
2890
0644
edit
dl
rm
RawModule.js
4275
0644
edit
dl
rm
RecordIdsPlugin.js
6775
0644
edit
dl
rm
RequestShortener.js
755
0644
edit
dl
rm
RequireJsStuffPlugin.js
1904
0644
edit
dl
rm
ResolverFactory.js
4938
0644
edit
dl
rm
RuntimeGlobals.js
7569
0644
edit
dl
rm
RuntimeModule.js
5520
0644
edit
dl
rm
RuntimePlugin.js
11842
0644
edit
dl
rm
RuntimeTemplate.js
27656
0644
edit
dl
rm
SelfModuleFactory.js
384
0644
edit
dl
rm
SingleEntryPlugin.js
161
0644
edit
dl
rm
SizeFormatHelpers.js
583
0644
edit
dl
rm
SourceMapDevToolModuleOptionsPlugin.js
1325
0644
edit
dl
rm
SourceMapDevToolPlugin.js
16631
0644
edit
dl
rm
Stats.js
2003
0644
edit
dl
rm
Template.js
12701
0644
edit
dl
rm
TemplatedPathPlugin.js
8036
0644
edit
dl
rm
UnhandledSchemeError.js
833
0644
edit
dl
rm
UnsupportedFeatureWarning.js
832
0644
edit
dl
rm
UseStrictPlugin.js
1645
0644
edit
dl
rm
validateSchema.js
6376
0644
edit
dl
rm
WarnCaseSensitiveModulesPlugin.js
1212
0644
edit
dl
rm
WarnDeprecatedOptionPlugin.js
1327
0644
edit
dl
rm
WarnNoModeSetPlugin.js
545
0644
edit
dl
rm
WatchIgnorePlugin.js
2816
0644
edit
dl
rm
Watching.js
10335
0644
edit
dl
rm
webpack.js
4722
0644
edit
dl
rm
WebpackError.js
1429
0644
edit
dl
rm
WebpackIsIncludedPlugin.js
2420
0644
edit
dl
rm
WebpackOptionsApply.js
22651
0644
edit
dl
rm
WebpackOptionsDefaulter.js
470
0644
edit
dl
rm
Edit:
/var/www/cobraambalaj/node_modules/webpack/lib/ModuleGraph.js
(21886B)
/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; const util = require("util"); const ExportsInfo = require("./ExportsInfo"); const ModuleGraphConnection = require("./ModuleGraphConnection"); const SortableSet = require("./util/SortableSet"); /** @typedef {import("./DependenciesBlock")} DependenciesBlock */ /** @typedef {import("./Dependency")} Dependency */ /** @typedef {import("./ExportsInfo").ExportInfo} ExportInfo */ /** @typedef {import("./Module")} Module */ /** @typedef {import("./ModuleProfile")} ModuleProfile */ /** @typedef {import("./RequestShortener")} RequestShortener */ /** @typedef {import("./util/runtime").RuntimeSpec} RuntimeSpec */ /** * @callback OptimizationBailoutFunction * @param {RequestShortener} requestShortener * @returns {string} */ const EMPTY_ARRAY = []; /** * @param {SortableSet<ModuleGraphConnection>} set input * @returns {readonly Map<Module, readonly ModuleGraphConnection[]>} mapped by origin module */ const getConnectionsByOriginModule = set => { const map = new Map(); /** @type {Module | 0} */ let lastModule = 0; /** @type {ModuleGraphConnection[]} */ let lastList = undefined; for (const connection of set) { const { originModule } = connection; if (lastModule === originModule) { lastList.push(connection); } else { lastModule = originModule; const list = map.get(originModule); if (list !== undefined) { lastList = list; list.push(connection); } else { const list = [connection]; lastList = list; map.set(originModule, list); } } } return map; }; class ModuleGraphModule { constructor() { /** @type {SortableSet<ModuleGraphConnection>} */ this.incomingConnections = new SortableSet(); /** @type {Set<ModuleGraphConnection> | undefined} */ this.outgoingConnections = undefined; /** @type {Module | null} */ this.issuer = undefined; /** @type {(string | OptimizationBailoutFunction)[]} */ this.optimizationBailout = []; /** @type {ExportsInfo} */ this.exports = new ExportsInfo(); /** @type {number} */ this.preOrderIndex = null; /** @type {number} */ this.postOrderIndex = null; /** @type {number} */ this.depth = null; /** @type {ModuleProfile} */ this.profile = undefined; /** @type {boolean} */ this.async = false; } } class ModuleGraphDependency { constructor() { /** @type {ModuleGraphConnection} */ this.connection = undefined; /** @type {Module} */ this.parentModule = undefined; /** @type {DependenciesBlock} */ this.parentBlock = undefined; } } class ModuleGraph { constructor() { /** @type {Map<Dependency, ModuleGraphDependency>} */ this._dependencyMap = new Map(); /** @type {Map<Module, ModuleGraphModule>} */ this._moduleMap = new Map(); /** @type {Map<Module, Set<ModuleGraphConnection>>} */ this._originMap = new Map(); /** @type {Map<any, Object>} */ this._metaMap = new Map(); // Caching this._cacheModuleGraphModuleKey1 = undefined; this._cacheModuleGraphModuleValue1 = undefined; this._cacheModuleGraphModuleKey2 = undefined; this._cacheModuleGraphModuleValue2 = undefined; this._cacheModuleGraphDependencyKey = undefined; this._cacheModuleGraphDependencyValue = undefined; } /** * @param {Module} module the module * @returns {ModuleGraphModule} the internal module */ _getModuleGraphModule(module) { if (this._cacheModuleGraphModuleKey1 === module) return this._cacheModuleGraphModuleValue1; if (this._cacheModuleGraphModuleKey2 === module) return this._cacheModuleGraphModuleValue2; let mgm = this._moduleMap.get(module); if (mgm === undefined) { mgm = new ModuleGraphModule(); this._moduleMap.set(module, mgm); } this._cacheModuleGraphModuleKey2 = this._cacheModuleGraphModuleKey1; this._cacheModuleGraphModuleValue2 = this._cacheModuleGraphModuleValue1; this._cacheModuleGraphModuleKey1 = module; this._cacheModuleGraphModuleValue1 = mgm; return mgm; } /** * @param {Dependency} dependency the dependency * @returns {ModuleGraphDependency} the internal dependency */ _getModuleGraphDependency(dependency) { if (this._cacheModuleGraphDependencyKey === dependency) return this._cacheModuleGraphDependencyValue; let mgd = this._dependencyMap.get(dependency); if (mgd === undefined) { mgd = new ModuleGraphDependency(); this._dependencyMap.set(dependency, mgd); } this._cacheModuleGraphDependencyKey = dependency; this._cacheModuleGraphDependencyValue = mgd; return mgd; } /** * @param {Dependency} dependency the dependency * @param {DependenciesBlock} block parent block * @param {Module} module parent module * @returns {void} */ setParents(dependency, block, module) { const mgd = this._getModuleGraphDependency(dependency); mgd.parentBlock = block; mgd.parentModule = module; } /** * @param {Dependency} dependency the dependency * @returns {Module} parent module */ getParentModule(dependency) { const mgd = this._getModuleGraphDependency(dependency); return mgd.parentModule; } /** * @param {Dependency} dependency the dependency * @returns {DependenciesBlock} parent block */ getParentBlock(dependency) { const mgd = this._getModuleGraphDependency(dependency); return mgd.parentBlock; } /** * @param {Module} originModule the referencing module * @param {Dependency} dependency the referencing dependency * @param {Module} module the referenced module * @returns {void} */ setResolvedModule(originModule, dependency, module) { const connection = new ModuleGraphConnection( originModule, dependency, module, undefined, dependency.weak, dependency.getCondition(this) ); const mgd = this._getModuleGraphDependency(dependency); mgd.connection = connection; const connections = this._getModuleGraphModule(module).incomingConnections; connections.add(connection); const mgm = this._getModuleGraphModule(originModule); if (mgm.outgoingConnections === undefined) { mgm.outgoingConnections = new Set(); } mgm.outgoingConnections.add(connection); } /** * @param {Dependency} dependency the referencing dependency * @param {Module} module the referenced module * @returns {void} */ updateModule(dependency, module) { const mgd = this._getModuleGraphDependency(dependency); if (mgd.connection.module === module) return; const { connection } = mgd; const newConnection = connection.clone(); newConnection.module = module; mgd.connection = newConnection; connection.setActive(false); const originMgm = this._getModuleGraphModule(connection.originModule); originMgm.outgoingConnections.add(newConnection); const targetMgm = this._getModuleGraphModule(module); targetMgm.incomingConnections.add(newConnection); } /** * @param {Dependency} dependency the referencing dependency * @returns {void} */ removeConnection(dependency) { const mgd = this._getModuleGraphDependency(dependency); const { connection } = mgd; const targetMgm = this._getModuleGraphModule(connection.module); targetMgm.incomingConnections.delete(connection); const originMgm = this._getModuleGraphModule(connection.originModule); originMgm.outgoingConnections.delete(connection); mgd.connection = undefined; } /** * @param {Dependency} dependency the referencing dependency * @param {string} explanation an explanation * @returns {void} */ addExplanation(dependency, explanation) { const { connection } = this._getModuleGraphDependency(dependency); connection.addExplanation(explanation); } /** * @param {Module} sourceModule the source module * @param {Module} targetModule the target module * @returns {void} */ cloneModuleAttributes(sourceModule, targetModule) { const oldMgm = this._getModuleGraphModule(sourceModule); const newMgm = this._getModuleGraphModule(targetModule); newMgm.postOrderIndex = oldMgm.postOrderIndex; newMgm.preOrderIndex = oldMgm.preOrderIndex; newMgm.depth = oldMgm.depth; newMgm.exports = oldMgm.exports; newMgm.async = oldMgm.async; } /** * @param {Module} module the module * @returns {void} */ removeModuleAttributes(module) { const mgm = this._getModuleGraphModule(module); mgm.postOrderIndex = null; mgm.preOrderIndex = null; mgm.depth = null; mgm.async = false; } /** * @returns {void} */ removeAllModuleAttributes() { for (const mgm of this._moduleMap.values()) { mgm.postOrderIndex = null; mgm.preOrderIndex = null; mgm.depth = null; mgm.async = false; } } /** * @param {Module} oldModule the old referencing module * @param {Module} newModule the new referencing module * @param {function(ModuleGraphConnection): boolean} filterConnection filter predicate for replacement * @returns {void} */ moveModuleConnections(oldModule, newModule, filterConnection) { if (oldModule === newModule) return; const oldMgm = this._getModuleGraphModule(oldModule); const newMgm = this._getModuleGraphModule(newModule); // Outgoing connections const oldConnections = oldMgm.outgoingConnections; if (oldConnections !== undefined) { if (newMgm.outgoingConnections === undefined) { newMgm.outgoingConnections = new Set(); } const newConnections = newMgm.outgoingConnections; for (const connection of oldConnections) { if (filterConnection(connection)) { connection.originModule = newModule; newConnections.add(connection); oldConnections.delete(connection); } } } // Incoming connections const oldConnections2 = oldMgm.incomingConnections; const newConnections2 = newMgm.incomingConnections; for (const connection of oldConnections2) { if (filterConnection(connection)) { connection.module = newModule; newConnections2.add(connection); oldConnections2.delete(connection); } } } /** * @param {Module} oldModule the old referencing module * @param {Module} newModule the new referencing module * @param {function(ModuleGraphConnection): boolean} filterConnection filter predicate for replacement * @returns {void} */ copyOutgoingModuleConnections(oldModule, newModule, filterConnection) { if (oldModule === newModule) return; const oldMgm = this._getModuleGraphModule(oldModule); const newMgm = this._getModuleGraphModule(newModule); // Outgoing connections const oldConnections = oldMgm.outgoingConnections; if (oldConnections !== undefined) { if (newMgm.outgoingConnections === undefined) { newMgm.outgoingConnections = new Set(); } const newConnections = newMgm.outgoingConnections; for (const connection of oldConnections) { if (filterConnection(connection)) { const newConnection = connection.clone(); newConnection.originModule = newModule; newConnections.add(newConnection); if (newConnection.module !== undefined) { const otherMgm = this._getModuleGraphModule(newConnection.module); otherMgm.incomingConnections.add(newConnection); } } } } } /** * @param {Module} module the referenced module * @param {string} explanation an explanation why it's referenced * @returns {void} */ addExtraReason(module, explanation) { const connections = this._getModuleGraphModule(module).incomingConnections; connections.add(new ModuleGraphConnection(null, null, module, explanation)); } /** * @param {Dependency} dependency the dependency to look for a referenced module * @returns {Module} the referenced module */ getResolvedModule(dependency) { const { connection } = this._getModuleGraphDependency(dependency); return connection !== undefined ? connection.resolvedModule : null; } /** * @param {Dependency} dependency the dependency to look for a referenced module * @returns {ModuleGraphConnection | undefined} the connection */ getConnection(dependency) { const { connection } = this._getModuleGraphDependency(dependency); return connection; } /** * @param {Dependency} dependency the dependency to look for a referenced module * @returns {Module} the referenced module */ getModule(dependency) { const { connection } = this._getModuleGraphDependency(dependency); return connection !== undefined ? connection.module : null; } /** * @param {Dependency} dependency the dependency to look for a referencing module * @returns {Module} the referencing module */ getOrigin(dependency) { const { connection } = this._getModuleGraphDependency(dependency); return connection !== undefined ? connection.originModule : null; } /** * @param {Dependency} dependency the dependency to look for a referencing module * @returns {Module} the original referencing module */ getResolvedOrigin(dependency) { const { connection } = this._getModuleGraphDependency(dependency); return connection !== undefined ? connection.resolvedOriginModule : null; } /** * @param {Module} module the module * @returns {Iterable<ModuleGraphConnection>} reasons why a module is included */ getIncomingConnections(module) { const connections = this._getModuleGraphModule(module).incomingConnections; return connections; } /** * @param {Module} module the module * @returns {Iterable<ModuleGraphConnection>} list of outgoing connections */ getOutgoingConnections(module) { const connections = this._getModuleGraphModule(module).outgoingConnections; return connections === undefined ? EMPTY_ARRAY : connections; } /** * @param {Module} module the module * @returns {readonly Map<Module, readonly ModuleGraphConnection[]>} reasons why a module is included, in a map by source module */ getIncomingConnectionsByOriginModule(module) { const connections = this._getModuleGraphModule(module).incomingConnections; return connections.getFromUnorderedCache(getConnectionsByOriginModule); } /** * @param {Module} module the module * @returns {ModuleProfile | null} the module profile */ getProfile(module) { const mgm = this._getModuleGraphModule(module); return mgm.profile; } /** * @param {Module} module the module * @param {ModuleProfile | null} profile the module profile * @returns {void} */ setProfile(module, profile) { const mgm = this._getModuleGraphModule(module); mgm.profile = profile; } /** * @param {Module} module the module * @returns {Module | null} the issuer module */ getIssuer(module) { const mgm = this._getModuleGraphModule(module); return mgm.issuer; } /** * @param {Module} module the module * @param {Module | null} issuer the issuer module * @returns {void} */ setIssuer(module, issuer) { const mgm = this._getModuleGraphModule(module); mgm.issuer = issuer; } /** * @param {Module} module the module * @param {Module | null} issuer the issuer module * @returns {void} */ setIssuerIfUnset(module, issuer) { const mgm = this._getModuleGraphModule(module); if (mgm.issuer === undefined) mgm.issuer = issuer; } /** * @param {Module} module the module * @returns {(string | OptimizationBailoutFunction)[]} optimization bailouts */ getOptimizationBailout(module) { const mgm = this._getModuleGraphModule(module); return mgm.optimizationBailout; } /** * @param {Module} module the module * @returns {true | string[] | null} the provided exports */ getProvidedExports(module) { const mgm = this._getModuleGraphModule(module); return mgm.exports.getProvidedExports(); } /** * @param {Module} module the module * @param {string | string[]} exportName a name of an export * @returns {boolean | null} true, if the export is provided by the module. * null, if it's unknown. * false, if it's not provided. */ isExportProvided(module, exportName) { const mgm = this._getModuleGraphModule(module); const result = mgm.exports.isExportProvided(exportName); return result === undefined ? null : result; } /** * @param {Module} module the module * @returns {ExportsInfo} info about the exports */ getExportsInfo(module) { const mgm = this._getModuleGraphModule(module); return mgm.exports; } /** * @param {Module} module the module * @param {string} exportName the export * @returns {ExportInfo} info about the export */ getExportInfo(module, exportName) { const mgm = this._getModuleGraphModule(module); return mgm.exports.getExportInfo(exportName); } /** * @param {Module} module the module * @param {string} exportName the export * @returns {ExportInfo} info about the export (do not modify) */ getReadOnlyExportInfo(module, exportName) { const mgm = this._getModuleGraphModule(module); return mgm.exports.getReadOnlyExportInfo(exportName); } /** * @param {Module} module the module * @param {RuntimeSpec} runtime the runtime * @returns {false | true | SortableSet<string> | null} the used exports * false: module is not used at all. * true: the module namespace/object export is used. * SortableSet<string>: these export names are used. * empty SortableSet<string>: module is used but no export. * null: unknown, worst case should be assumed. */ getUsedExports(module, runtime) { const mgm = this._getModuleGraphModule(module); return mgm.exports.getUsedExports(runtime); } /** * @param {Module} module the module * @returns {number} the index of the module */ getPreOrderIndex(module) { const mgm = this._getModuleGraphModule(module); return mgm.preOrderIndex; } /** * @param {Module} module the module * @returns {number} the index of the module */ getPostOrderIndex(module) { const mgm = this._getModuleGraphModule(module); return mgm.postOrderIndex; } /** * @param {Module} module the module * @param {number} index the index of the module * @returns {void} */ setPreOrderIndex(module, index) { const mgm = this._getModuleGraphModule(module); mgm.preOrderIndex = index; } /** * @param {Module} module the module * @param {number} index the index of the module * @returns {boolean} true, if the index was set */ setPreOrderIndexIfUnset(module, index) { const mgm = this._getModuleGraphModule(module); if (mgm.preOrderIndex === null) { mgm.preOrderIndex = index; return true; } return false; } /** * @param {Module} module the module * @param {number} index the index of the module * @returns {void} */ setPostOrderIndex(module, index) { const mgm = this._getModuleGraphModule(module); mgm.postOrderIndex = index; } /** * @param {Module} module the module * @param {number} index the index of the module * @returns {boolean} true, if the index was set */ setPostOrderIndexIfUnset(module, index) { const mgm = this._getModuleGraphModule(module); if (mgm.postOrderIndex === null) { mgm.postOrderIndex = index; return true; } return false; } /** * @param {Module} module the module * @returns {number} the depth of the module */ getDepth(module) { const mgm = this._getModuleGraphModule(module); return mgm.depth; } /** * @param {Module} module the module * @param {number} depth the depth of the module * @returns {void} */ setDepth(module, depth) { const mgm = this._getModuleGraphModule(module); mgm.depth = depth; } /** * @param {Module} module the module * @param {number} depth the depth of the module * @returns {boolean} true, if the depth was set */ setDepthIfLower(module, depth) { const mgm = this._getModuleGraphModule(module); if (mgm.depth === null || mgm.depth > depth) { mgm.depth = depth; return true; } return false; } /** * @param {Module} module the module * @returns {boolean} true, if the module is async */ isAsync(module) { const mgm = this._getModuleGraphModule(module); return mgm.async; } /** * @param {Module} module the module * @returns {void} */ setAsync(module) { const mgm = this._getModuleGraphModule(module); mgm.async = true; } /** * @param {any} thing any thing * @returns {Object} metadata */ getMeta(thing) { let meta = this._metaMap.get(thing); if (meta === undefined) { meta = Object.create(null); this._metaMap.set(thing, meta); } return meta; } /** * @param {any} thing any thing * @returns {Object} metadata */ getMetaIfExisting(thing) { return this._metaMap.get(thing); } // TODO remove in webpack 6 /** * @param {Module} module the module * @param {string} deprecateMessage message for the deprecation message * @param {string} deprecationCode code for the deprecation * @returns {ModuleGraph} the module graph */ static getModuleGraphForModule(module, deprecateMessage, deprecationCode) { const fn = deprecateMap.get(deprecateMessage); if (fn) return fn(module); const newFn = util.deprecate( /** * @param {Module} module the module * @returns {ModuleGraph} the module graph */ module => { const moduleGraph = moduleGraphForModuleMap.get(module); if (!moduleGraph) throw new Error( deprecateMessage + "There was no ModuleGraph assigned to the Module for backward-compat (Use the new API)" ); return moduleGraph; }, deprecateMessage + ": Use new ModuleGraph API", deprecationCode ); deprecateMap.set(deprecateMessage, newFn); return newFn(module); } // TODO remove in webpack 6 /** * @param {Module} module the module * @param {ModuleGraph} moduleGraph the module graph * @returns {void} */ static setModuleGraphForModule(module, moduleGraph) { moduleGraphForModuleMap.set(module, moduleGraph); } } // TODO remove in webpack 6 /** @type {WeakMap<Module, ModuleGraph>} */ const moduleGraphForModuleMap = new WeakMap(); // TODO remove in webpack 6 /** @type {Map<string, (module: Module) => ModuleGraph>} */ const deprecateMap = new Map(); module.exports = ModuleGraph; module.exports.ModuleGraphConnection = ModuleGraphConnection;
Save
cmd:
run