On this page

new Dependency(): Dependency
Returns:Dependency
Attributes
category:string
Returns a dependency category, typical categories are "commonjs", "amd", "esm".
disconnect:any
Returns location.
module:any
optional:boolean
type:string
Returns a display name for the type of dependency.
weak:boolean
EXPORTS_OBJECT_REFERENCED:string[][]
NO_EXPORTS_REFERENCED:string[][]
TRANSITIVE:symbol
Defines the referenced export type used by this module.
canConcatenate(): boolean
Returns:boolean
true if this dependency supports concatenation

Returns true if the dependency can be concatenated (scope hoisting).


couldAffectReferencingModule(): boolean | symbol
Returns:boolean | symbol
true, when changes to the referenced module could affect the referencing module; TRANSITIVE, when changes to the referenced module could affect referencing modules of the referencing module

Could affect referencing module.


createIgnoredModule(context): Module
Attributes
context:string
context directory
Returns:Module
ignored module

Creates an ignored module.


deserialize(objectDeserializerContext): void
Attributes
objectDeserializerContext:ObjectDeserializerContext
Returns:void

Restores this instance from the provided deserializer context.


getCondition(moduleGraph): false | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | null
Attributes
moduleGraph:ModuleGraph
module graph
Returns:false | ((moduleGraphConnection: ModuleGraphConnection, runtime: RuntimeSpec) => ConnectionState) | null
function to determine if the connection is active

Returns function to determine if the connection is active.


getContext(): string | undefined
Returns:string | undefined
a request context

Returns a request context.


getErrors(moduleGraph): WebpackError[] | null | undefined
Attributes
moduleGraph:ModuleGraph
module graph
Returns:WebpackError[] | null | undefined
errors

Returns errors.


getExports(moduleGraph): ExportsSpec | undefined
Attributes
moduleGraph:ModuleGraph
module graph
export names

Returns the exported names


getModuleEvaluationSideEffectsState(moduleGraph): ConnectionState
Attributes
moduleGraph:ModuleGraph
the module graph
how this dependency connects the module to referencing modules

Gets module evaluation side effects state.


getNumberOfIdOccurrences(): number
Returns:number
count how often the id is used in this dependency

implement this method to allow the occurrence order plugin to count correctly


getReference(moduleGraph): never
Attributes
moduleGraph:ModuleGraph
module graph
Returns:never
throws error

Returns the referenced module and export


getReferencedExports(moduleGraph, runtime): (string[] | ReferencedExport)[]
Attributes
moduleGraph:ModuleGraph
module graph
runtime:RuntimeSpec
the runtime for which the module is analysed
Returns:(string[] | ReferencedExport)[]
referenced exports

Returns list of exports referenced by this dependency


getResourceIdentifier(): string | null
Returns:string | null
an identifier to merge equal requests

Returns an identifier to merge equal requests.


getWarnings(moduleGraph): WebpackError[] | null | undefined
Attributes
moduleGraph:ModuleGraph
module graph
Returns:WebpackError[] | null | undefined
warnings

Returns warnings.


serialize(objectSerializerContext): void
Attributes
objectSerializerContext:ObjectSerializerContext
Returns:void

Serializes this instance into the provided serializer context.


setLoc(startLine, startColumn, endLine, endColumn): void
Attributes
startLine:number
start line
startColumn:number
start column
endLine:number
end line
endColumn:number
end column
Returns:void

Updates loc using the provided start line.


updateHash(hash, context): void
Attributes
hash:Hash
hash to be updated
Returns:void

Updates the hash with the data contributed by this instance.


Attributes
dependency:Dependency
dep
Returns:boolean
true if this dependency supports concatenation

Returns true if the dependency can be concatenated (scope hoisting).


Attributes
dependency:Dependency
dep
Returns:boolean
true if the dependency is a low priority dependency

Returns true if the dependency is a low priority dependency.