class webpack.dependencies.ModuleDependency extends Dependencynew ModuleDependency(request, sourceOrder?): ModuleDependencystringnumberModuleDependencyCreates an instance of ModuleDependency.
stringanyanybooleanstringnumberstringstringbooleanstring[][]string[][]"*""id""local"LAZY_UNTIL_LOCAL
: locally provided export name (
getLazyName
), requesting it requires no dependency.
LAZY_UNTIL_ID
: named re-export (
getLazyName
) deferred until the export name is requested.
LAZY_UNTIL_FALLBACK
: star re-export, deferred until an unknown name or all names are requested.
LAZY_UNTIL_REQUEST
: deferred together with other dependencies of the same request."@"string[][]typeof DependencyTemplatesymbolcanConcatenate(): booleanbooleanReturns true if this dependency can be concatenated
couldAffectReferencingModule(): boolean | symbolCould affect referencing module.
createIgnoredModule(context): ModuleCreates an ignored module.
deserialize(objectDeserializerContextObjectMiddlewareObject_4): voidObjectDeserializerContextObjectMiddlewareObject_4voidRestores this instance from the provided deserializer context.
getCondition(moduleGraph): false | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | nullModuleGraphfalse | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | nullReturns function to determine if the connection is active.
getContext(): string | undefinedReturns a request context.
getErrors(moduleGraph): WebpackError[] | null | undefinedModuleGraphWebpackError[] | null | undefinedReturns errors.
getExports(moduleGraph): ExportsSpec | undefinedModuleGraphExportsSpec | undefinedReturns the exported names
getForwardId(): string | true | nullstring | true | nullReturns the export name this dependency requests from its target module (lazy barrel optimization).
getLazyName(): string | nullstring | nullReturns the export name for a LAZY_UNTIL_LOCAL/LAZY_UNTIL_ID classification (lazy barrel optimization).
getLazyUntil(): "local" | "id" | "*" | "@" | null"local" | "id" | "*" | "@" | nullReturns how this dependency may be deferred when its parent module is side-effect-free (lazy barrel optimization).
getModuleEvaluationSideEffectsState(moduleGraph): ConnectionStateModuleGraphConnectionStateGets module evaluation side effects state.
getNumberOfIdOccurrences(): numbernumberimplement this method to allow the occurrence order plugin to count correctly
getReference(moduleGraph): neverModuleGraphneverReturns the referenced module and export
getReferencedExports(moduleGraph, runtime): (string[] | ReferencedExport)[]Returns list of exports referenced by this dependency
getResourceIdentifier(): string | nullstring | nullReturns an identifier to merge equal requests.
getWarnings(moduleGraph): WebpackError[] | null | undefinedModuleGraphWebpackError[] | null | undefinedReturns warnings.
isLazy(): booleanbooleanWhether the lazy barrel currently defers creating this dependency's target module (lazy barrel optimization).
serialize(objectSerializerContextObjectMiddlewareObject_5): voidObjectSerializerContextObjectMiddlewareObject_5voidSerializes this instance into the provided serializer context.
setLazy(value): voidSets whether the lazy barrel defers creating this dependency's target module (lazy barrel optimization).
setLoc(startLine, startColumn, endLine, endColumn): voidUpdates loc using the provided start line.
setLocWithIndex(loc, index): voidUpdates loc from a source location plus an explicit index, without
materializing the loc object (keeps get loc lazy). Replaces the
dep.loc = Object.create(loc); dep.loc.index = i pattern, which both
allocated a copy and stored the index outside the serialized fields.
updateHash(hash, context): voidUpdates the hash with the data contributed by this instance.
DependencybooleanReturns true if the dependency can be concatenated (scope hoisting).
Compares two dependencies by source location for sorting a module's
dependencies, without materializing the loc objects (get loc caches
its result, so comparing through it would retain a location object on every
sorted dependency). These dependencies always carry a real source position,
so only start (line, column) and the within-statement index are compared; a
dependency without an index sorts after one that has an index at the same
position.
DependencybooleanReturns true if the dependency is a low priority dependency.