Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.143.215.114
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
wb /
node_modules /
webpack /
lib /
Delete
Unzip
Name
Size
Permission
Date
Action
asset
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
async-modules
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
cache
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
config
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
container
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
css
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
debug
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
dependencies
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
electron
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
errors
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
esm
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
hmr
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
ids
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
javascript
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
json
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
library
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
logging
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
node
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
optimize
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
performance
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
prefetch
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
rules
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
runtime
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
schemes
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
serialization
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
sharing
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
stats
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
util
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
wasm
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
wasm-async
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
wasm-sync
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
web
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
webworker
[ DIR ]
drwxrwxr-x
2022-08-30 11:49
APIPlugin.js
6.72
KB
-rw-rw-r--
2022-08-30 11:49
AbstractMethodError.js
1.11
KB
-rw-rw-r--
2022-08-30 11:49
AsyncDependenciesBlock.js
2.86
KB
-rw-rw-r--
2022-08-30 11:49
AsyncDependencyToInitialChunkError.js
913
B
-rw-rw-r--
2022-08-30 11:49
AutomaticPrefetchPlugin.js
1.46
KB
-rw-rw-r--
2022-08-30 11:49
BannerPlugin.js
2.93
KB
-rw-rw-r--
2022-08-30 11:49
Cache.js
3.88
KB
-rw-rw-r--
2022-08-30 11:49
CacheFacade.js
8.38
KB
-rw-rw-r--
2022-08-30 11:49
CaseSensitiveModulesWarning.js
2.06
KB
-rw-rw-r--
2022-08-30 11:49
Chunk.js
21.1
KB
-rw-rw-r--
2022-08-30 11:49
ChunkGraph.js
49.33
KB
-rw-rw-r--
2022-08-30 11:49
ChunkGroup.js
14.77
KB
-rw-rw-r--
2022-08-30 11:49
ChunkRenderError.js
657
B
-rw-rw-r--
2022-08-30 11:49
ChunkTemplate.js
3.9
KB
-rw-rw-r--
2022-08-30 11:49
CleanPlugin.js
11.24
KB
-rw-rw-r--
2022-08-30 11:49
CodeGenerationError.js
619
B
-rw-rw-r--
2022-08-30 11:49
CodeGenerationResults.js
4.36
KB
-rw-rw-r--
2022-08-30 11:49
CommentCompilationWarning.js
729
B
-rw-rw-r--
2022-08-30 11:49
CompatibilityPlugin.js
4.54
KB
-rw-rw-r--
2022-08-30 11:49
Compilation.js
157.69
KB
-rw-rw-r--
2022-08-30 11:49
Compiler.js
35.03
KB
-rw-rw-r--
2022-08-30 11:49
ConcatenationScope.js
4.53
KB
-rw-rw-r--
2022-08-30 11:49
ConcurrentCompilationError.js
441
B
-rw-rw-r--
2022-08-30 11:49
ConditionalInitFragment.js
3.36
KB
-rw-rw-r--
2022-08-30 11:49
ConstPlugin.js
14.42
KB
-rw-rw-r--
2022-08-30 11:49
ContextExclusionPlugin.js
797
B
-rw-rw-r--
2022-08-30 11:49
ContextModule.js
33.63
KB
-rw-rw-r--
2022-08-30 11:49
ContextModuleFactory.js
12.3
KB
-rw-rw-r--
2022-08-30 11:49
ContextReplacementPlugin.js
4.61
KB
-rw-rw-r--
2022-08-30 11:49
DefinePlugin.js
16.28
KB
-rw-rw-r--
2022-08-30 11:49
DelegatedModule.js
7.08
KB
-rw-rw-r--
2022-08-30 11:49
DelegatedModuleFactoryPlugin.js
2.28
KB
-rw-rw-r--
2022-08-30 11:49
DelegatedPlugin.js
1015
B
-rw-rw-r--
2022-08-30 11:49
DependenciesBlock.js
2.53
KB
-rw-rw-r--
2022-08-30 11:49
Dependency.js
9.36
KB
-rw-rw-r--
2022-08-30 11:49
DependencyTemplate.js
2.43
KB
-rw-rw-r--
2022-08-30 11:49
DependencyTemplates.js
1.69
KB
-rw-rw-r--
2022-08-30 11:49
DllEntryPlugin.js
1.25
KB
-rw-rw-r--
2022-08-30 11:49
DllModule.js
4.4
KB
-rw-rw-r--
2022-08-30 11:49
DllModuleFactory.js
1008
B
-rw-rw-r--
2022-08-30 11:49
DllPlugin.js
1.66
KB
-rw-rw-r--
2022-08-30 11:49
DllReferencePlugin.js
5.01
KB
-rw-rw-r--
2022-08-30 11:49
DynamicEntryPlugin.js
1.99
KB
-rw-rw-r--
2022-08-30 11:49
EntryOptionPlugin.js
2.77
KB
-rw-rw-r--
2022-08-30 11:49
EntryPlugin.js
1.7
KB
-rw-rw-r--
2022-08-30 11:49
Entrypoint.js
2.95
KB
-rw-rw-r--
2022-08-30 11:49
EnvironmentPlugin.js
1.7
KB
-rw-rw-r--
2022-08-30 11:49
ErrorHelpers.js
1.42
KB
-rw-rw-r--
2022-08-30 11:49
EvalDevToolModulePlugin.js
3.67
KB
-rw-rw-r--
2022-08-30 11:49
EvalSourceMapDevToolPlugin.js
6.67
KB
-rw-rw-r--
2022-08-30 11:49
ExportsInfo.js
42.96
KB
-rw-rw-r--
2022-08-30 11:49
ExportsInfoApiPlugin.js
2.02
KB
-rw-rw-r--
2022-08-30 11:49
ExternalModule.js
21.94
KB
-rw-rw-r--
2022-08-30 11:49
ExternalModuleFactoryPlugin.js
7.06
KB
-rw-rw-r--
2022-08-30 11:49
ExternalsPlugin.js
899
B
-rw-rw-r--
2022-08-30 11:49
FileSystemInfo.js
102.03
KB
-rw-rw-r--
2022-08-30 11:49
FlagAllModulesAsUsedPlugin.js
1.42
KB
-rw-rw-r--
2022-08-30 11:49
FlagDependencyExportsPlugin.js
12.91
KB
-rw-rw-r--
2022-08-30 11:49
FlagDependencyUsagePlugin.js
10.74
KB
-rw-rw-r--
2022-08-30 11:49
FlagEntryExportAsUsedPlugin.js
1.34
KB
-rw-rw-r--
2022-08-30 11:49
Generator.js
4.73
KB
-rw-rw-r--
2022-08-30 11:49
GraphHelpers.js
1.05
KB
-rw-rw-r--
2022-08-30 11:49
HarmonyLinkingError.js
357
B
-rw-rw-r--
2022-08-30 11:49
HookWebpackError.js
2.03
KB
-rw-rw-r--
2022-08-30 11:49
HotModuleReplacementPlugin.js
25.72
KB
-rw-rw-r--
2022-08-30 11:49
HotUpdateChunk.js
353
B
-rw-rw-r--
2022-08-30 11:49
IgnoreErrorModuleFactory.js
1.02
KB
-rw-rw-r--
2022-08-30 11:49
IgnorePlugin.js
2.2
KB
-rw-rw-r--
2022-08-30 11:49
IgnoreWarningsPlugin.js
964
B
-rw-rw-r--
2022-08-30 11:49
InitFragment.js
4.54
KB
-rw-rw-r--
2022-08-30 11:49
InvalidDependenciesModuleWarning.js
1.83
KB
-rw-rw-r--
2022-08-30 11:49
JavascriptMetaInfoPlugin.js
2.03
KB
-rw-rw-r--
2022-08-30 11:49
LibManifestPlugin.js
3.04
KB
-rw-rw-r--
2022-08-30 11:49
LibraryTemplatePlugin.js
1.55
KB
-rw-rw-r--
2022-08-30 11:49
LoaderOptionsPlugin.js
1.81
KB
-rw-rw-r--
2022-08-30 11:49
LoaderTargetPlugin.js
747
B
-rw-rw-r--
2022-08-30 11:49
MainTemplate.js
10.15
KB
-rw-rw-r--
2022-08-30 11:49
Module.js
29.96
KB
-rw-rw-r--
2022-08-30 11:49
ModuleBuildError.js
1.59
KB
-rw-rw-r--
2022-08-30 11:49
ModuleDependencyError.js
1.08
KB
-rw-rw-r--
2022-08-30 11:49
ModuleDependencyWarning.js
1.19
KB
-rw-rw-r--
2022-08-30 11:49
ModuleError.js
1.17
KB
-rw-rw-r--
2022-08-30 11:49
ModuleFactory.js
1.39
KB
-rw-rw-r--
2022-08-30 11:49
ModuleFilenameHelpers.js
7.98
KB
-rw-rw-r--
2022-08-30 11:49
ModuleGraph.js
23.99
KB
-rw-rw-r--
2022-08-30 11:49
ModuleGraphConnection.js
5.09
KB
-rw-rw-r--
2022-08-30 11:49
ModuleHashingError.js
615
B
-rw-rw-r--
2022-08-30 11:49
ModuleInfoHeaderPlugin.js
7.01
KB
-rw-rw-r--
2022-08-30 11:49
ModuleNotFoundError.js
2.55
KB
-rw-rw-r--
2022-08-30 11:49
ModuleParseError.js
3.25
KB
-rw-rw-r--
2022-08-30 11:49
ModuleProfile.js
2.38
KB
-rw-rw-r--
2022-08-30 11:49
ModuleRestoreError.js
957
B
-rw-rw-r--
2022-08-30 11:49
ModuleStoreError.js
951
B
-rw-rw-r--
2022-08-30 11:49
ModuleTemplate.js
3.91
KB
-rw-rw-r--
2022-08-30 11:49
ModuleWarning.js
1.25
KB
-rw-rw-r--
2022-08-30 11:49
MultiCompiler.js
15.67
KB
-rw-rw-r--
2022-08-30 11:49
MultiStats.js
4.12
KB
-rw-rw-r--
2022-08-30 11:49
MultiWatching.js
1.44
KB
-rw-rw-r--
2022-08-30 11:49
NoEmitOnErrorsPlugin.js
713
B
-rw-rw-r--
2022-08-30 11:49
NoModeWarning.js
663
B
-rw-rw-r--
2022-08-30 11:49
NodeStuffInWebError.js
843
B
-rw-rw-r--
2022-08-30 11:49
NodeStuffPlugin.js
5.27
KB
-rw-rw-r--
2022-08-30 11:49
NormalModule.js
41.09
KB
-rw-rw-r--
2022-08-30 11:49
NormalModuleFactory.js
31.6
KB
-rw-rw-r--
2022-08-30 11:49
NormalModuleReplacementPlugin.js
1.84
KB
-rw-rw-r--
2022-08-30 11:49
NullFactory.js
628
B
-rw-rw-r--
2022-08-30 11:49
OptimizationStages.js
204
B
-rw-rw-r--
2022-08-30 11:49
OptionsApply.js
201
B
-rw-rw-r--
2022-08-30 11:49
Parser.js
968
B
-rw-rw-r--
2022-08-30 11:49
PrefetchPlugin.js
1.02
KB
-rw-rw-r--
2022-08-30 11:49
ProgressPlugin.js
16.78
KB
-rw-rw-r--
2022-08-30 11:49
ProvidePlugin.js
2.82
KB
-rw-rw-r--
2022-08-30 11:49
RawModule.js
4.53
KB
-rw-rw-r--
2022-08-30 11:49
RecordIdsPlugin.js
6.66
KB
-rw-rw-r--
2022-08-30 11:49
RequestShortener.js
755
B
-rw-rw-r--
2022-08-30 11:49
RequireJsStuffPlugin.js
1.86
KB
-rw-rw-r--
2022-08-30 11:49
ResolverFactory.js
4.83
KB
-rw-rw-r--
2022-08-30 11:49
RuntimeGlobals.js
9.01
KB
-rw-rw-r--
2022-08-30 11:49
RuntimeModule.js
5.63
KB
-rw-rw-r--
2022-08-30 11:49
RuntimePlugin.js
14.68
KB
-rw-rw-r--
2022-08-30 11:49
RuntimeTemplate.js
31.11
KB
-rw-rw-r--
2022-08-30 11:49
SelfModuleFactory.js
384
B
-rw-rw-r--
2022-08-30 11:49
SingleEntryPlugin.js
161
B
-rw-rw-r--
2022-08-30 11:49
SizeFormatHelpers.js
583
B
-rw-rw-r--
2022-08-30 11:49
SourceMapDevToolModuleOptionsPlugin.js
1.29
KB
-rw-rw-r--
2022-08-30 11:49
SourceMapDevToolPlugin.js
16.61
KB
-rw-rw-r--
2022-08-30 11:49
Stats.js
1.96
KB
-rw-rw-r--
2022-08-30 11:49
Template.js
12.52
KB
-rw-rw-r--
2022-08-30 11:49
TemplatedPathPlugin.js
8.58
KB
-rw-rw-r--
2022-08-30 11:49
UnhandledSchemeError.js
833
B
-rw-rw-r--
2022-08-30 11:49
UnsupportedFeatureWarning.js
780
B
-rw-rw-r--
2022-08-30 11:49
UseStrictPlugin.js
1.61
KB
-rw-rw-r--
2022-08-30 11:49
WarnCaseSensitiveModulesPlugin.js
1.38
KB
-rw-rw-r--
2022-08-30 11:49
WarnDeprecatedOptionPlugin.js
1.25
KB
-rw-rw-r--
2022-08-30 11:49
WarnNoModeSetPlugin.js
545
B
-rw-rw-r--
2022-08-30 11:49
WatchIgnorePlugin.js
3.27
KB
-rw-rw-r--
2022-08-30 11:49
Watching.js
12.62
KB
-rw-rw-r--
2022-08-30 11:49
WebpackError.js
1.34
KB
-rw-rw-r--
2022-08-30 11:49
WebpackIsIncludedPlugin.js
2.36
KB
-rw-rw-r--
2022-08-30 11:49
WebpackOptionsApply.js
25.69
KB
-rw-rw-r--
2022-08-30 11:49
WebpackOptionsDefaulter.js
470
B
-rw-rw-r--
2022-08-30 11:49
buildChunkGraph.js
44.55
KB
-rw-rw-r--
2022-08-30 11:49
cli.js
16.2
KB
-rw-rw-r--
2022-08-30 11:49
formatLocation.js
1.74
KB
-rw-rw-r--
2022-08-30 11:49
index.js
16.21
KB
-rw-rw-r--
2022-08-30 11:49
validateSchema.js
6.25
KB
-rw-rw-r--
2022-08-30 11:49
webpack.js
5.27
KB
-rw-rw-r--
2022-08-30 11:49
Save
Rename
/* 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"); const WeakTupleMap = require("./util/WeakTupleMap"); /** @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_SET = new Set(); /** * @param {SortableSet<ModuleGraphConnection>} set input * @returns {readonly Map<Module | undefined, 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; }; /** * @param {SortableSet<ModuleGraphConnection>} set input * @returns {readonly Map<Module | undefined, readonly ModuleGraphConnection[]>} mapped by module */ const getConnectionsByModule = set => { const map = new Map(); /** @type {Module | 0} */ let lastModule = 0; /** @type {ModuleGraphConnection[]} */ let lastList = undefined; for (const connection of set) { const { module } = connection; if (lastModule === module) { lastList.push(connection); } else { lastModule = module; const list = map.get(module); if (list !== undefined) { lastList = list; list.push(connection); } else { const list = [connection]; lastList = list; map.set(module, list); } } } return map; }; class ModuleGraphModule { constructor() { /** @type {SortableSet<ModuleGraphConnection>} */ this.incomingConnections = new SortableSet(); /** @type {SortableSet<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; /** @type {ModuleGraphConnection[]} */ this._unassignedConnections = undefined; } } class ModuleGraph { constructor() { /** @type {WeakMap<Dependency, ModuleGraphConnection>} */ this._dependencyMap = new WeakMap(); /** @type {Map<Module, ModuleGraphModule>} */ this._moduleMap = new Map(); /** @type {WeakMap<any, Object>} */ this._metaMap = new WeakMap(); /** @type {WeakTupleMap<any[], any>} */ this._cache = undefined; /** @type {Map<Module, WeakTupleMap<any, any>>} */ this._moduleMemCaches = undefined; } /** * @param {Module} module the module * @returns {ModuleGraphModule} the internal module */ _getModuleGraphModule(module) { let mgm = this._moduleMap.get(module); if (mgm === undefined) { mgm = new ModuleGraphModule(); this._moduleMap.set(module, mgm); } return mgm; } /** * @param {Dependency} dependency the dependency * @param {DependenciesBlock} block parent block * @param {Module} module parent module * @param {number=} indexInBlock position in block * @returns {void} */ setParents(dependency, block, module, indexInBlock = -1) { dependency._parentDependenciesBlockIndex = indexInBlock; dependency._parentDependenciesBlock = block; dependency._parentModule = module; } /** * @param {Dependency} dependency the dependency * @returns {Module} parent module */ getParentModule(dependency) { return dependency._parentModule; } /** * @param {Dependency} dependency the dependency * @returns {DependenciesBlock} parent block */ getParentBlock(dependency) { return dependency._parentDependenciesBlock; } /** * @param {Dependency} dependency the dependency * @returns {number} index */ getParentBlockIndex(dependency) { return dependency._parentDependenciesBlockIndex; } /** * @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 connections = this._getModuleGraphModule(module).incomingConnections; connections.add(connection); if (originModule) { const mgm = this._getModuleGraphModule(originModule); if (mgm._unassignedConnections === undefined) { mgm._unassignedConnections = []; } mgm._unassignedConnections.push(connection); if (mgm.outgoingConnections === undefined) { mgm.outgoingConnections = new SortableSet(); } mgm.outgoingConnections.add(connection); } else { this._dependencyMap.set(dependency, connection); } } /** * @param {Dependency} dependency the referencing dependency * @param {Module} module the referenced module * @returns {void} */ updateModule(dependency, module) { const connection = this.getConnection(dependency); if (connection.module === module) return; const newConnection = connection.clone(); newConnection.module = module; this._dependencyMap.set(dependency, 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 connection = this.getConnection(dependency); const targetMgm = this._getModuleGraphModule(connection.module); targetMgm.incomingConnections.delete(connection); const originMgm = this._getModuleGraphModule(connection.originModule); originMgm.outgoingConnections.delete(connection); this._dependencyMap.set(dependency, null); } /** * @param {Dependency} dependency the referencing dependency * @param {string} explanation an explanation * @returns {void} */ addExplanation(dependency, explanation) { const connection = this.getConnection(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 SortableSet(); } 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 SortableSet(); } 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.getConnection(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._dependencyMap.get(dependency); if (connection === undefined) { const module = this.getParentModule(dependency); if (module !== undefined) { const mgm = this._getModuleGraphModule(module); if ( mgm._unassignedConnections && mgm._unassignedConnections.length !== 0 ) { let foundConnection; for (const connection of mgm._unassignedConnections) { this._dependencyMap.set(connection.dependency, connection); if (connection.dependency === dependency) foundConnection = connection; } mgm._unassignedConnections.length = 0; if (foundConnection !== undefined) { return foundConnection; } } } this._dependencyMap.set(dependency, null); return undefined; } return connection === null ? undefined : connection; } /** * @param {Dependency} dependency the dependency to look for a referenced module * @returns {Module} the referenced module */ getModule(dependency) { const connection = this.getConnection(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.getConnection(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.getConnection(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_SET : connections; } /** * @param {Module} module the module * @returns {readonly Map<Module | undefined, 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 {readonly Map<Module | undefined, readonly ModuleGraphConnection[]> | undefined} connections to modules, in a map by module */ getOutgoingConnectionsByModule(module) { const connections = this._getModuleGraphModule(module).outgoingConnections; return connections === undefined ? undefined : connections.getFromUnorderedCache(getConnectionsByModule); } /** * @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); } /** * @param {string=} cacheStage a persistent stage name for caching */ freeze(cacheStage) { this._cache = new WeakTupleMap(); this._cacheStage = cacheStage; } unfreeze() { this._cache = undefined; this._cacheStage = undefined; } /** * @template {any[]} T * @template V * @param {(moduleGraph: ModuleGraph, ...args: T) => V} fn computer * @param {T} args arguments * @returns {V} computed value or cached */ cached(fn, ...args) { if (this._cache === undefined) return fn(this, ...args); return this._cache.provide(fn, ...args, () => fn(this, ...args)); } /** * @param {Map<Module, WeakTupleMap<any, any>>} moduleMemCaches mem caches for modules for better caching */ setModuleMemCaches(moduleMemCaches) { this._moduleMemCaches = moduleMemCaches; } /** * @param {Dependency} dependency dependency * @param {...any} args arguments, last argument is a function called with moduleGraph, dependency, ...args * @returns {any} computed value or cached */ dependencyCacheProvide(dependency, ...args) { /** @type {(moduleGraph: ModuleGraph, dependency: Dependency, ...args: any[]) => any} */ const fn = args.pop(); if (this._moduleMemCaches && this._cacheStage) { const memCache = this._moduleMemCaches.get( this.getParentModule(dependency) ); if (memCache !== undefined) { return memCache.provide(dependency, this._cacheStage, ...args, () => fn(this, dependency, ...args) ); } } if (this._cache === undefined) return fn(this, dependency, ...args); return this._cache.provide(dependency, ...args, () => fn(this, dependency, ...args) ); } // 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 /** * @param {Module} module the module * @returns {void} */ static clearModuleGraphForModule(module) { moduleGraphForModuleMap.delete(module); } } // 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;