On this page

  • {ModuleDependency}
  • {NullDependency}
new Dependency(): Dependency
Returns:
{Dependency}
Attributes
category:<string>
disconnect:<any>
loc:
{DependencyLocation}
module:<any>
optional:<boolean>
EXPORTS_OBJECT_REFERENCED:
{string[][]}
NO_EXPORTS_REFERENCED:
{string[][]}
TRANSITIVE:<symbol>
webpack.Dependency.couldAffectReferencingModule(): 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

webpack.Dependency.createIgnoredModule(context): Module
Attributes
context:<string>
context directory
Returns:
{Module} ignored module

webpack.Dependency.deserialize(__namedParameters): void
  • __namedParameters {ObjectDeserializerContext} context
  • Returns: {void}

webpack.Dependency.getCondition(moduleGraph): void
  • moduleGraph {ModuleGraph} module graph
  • Returns: <object> function to determine if the connection is active

webpack.Dependency.getContext(): string
Returns:<string>
a request context

webpack.Dependency.getErrors(moduleGraph): void
  • moduleGraph {ModuleGraph} module graph
  • Returns: {WebpackError[]} errors

Returns errors


webpack.Dependency.getExports(moduleGraph): void
  • moduleGraph {ModuleGraph} module graph
  • Returns: {ExportsSpec} export names

Returns the exported names


webpack.Dependency.getModuleEvaluationSideEffectsState(moduleGraph): void
  • moduleGraph {ModuleGraph} the module graph
  • Returns: {ConnectionState} how this dependency connects the module to referencing modules

webpack.Dependency.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


webpack.Dependency.getReference(moduleGraph): void
  • moduleGraph {ModuleGraph} module graph
  • Returns: {never} throws error

Returns the referenced module and export


webpack.Dependency.getReferencedExports(moduleGraph, runtime): void
  • moduleGraph {ModuleGraph} module graph
  • runtime {RuntimeSpec} the runtime for which the module is analysed
  • Returns: <string[]> referenced exports

Returns list of exports referenced by this dependency


webpack.Dependency.getResourceIdentifier(): string
Returns:<string>
an identifier to merge equal requests

webpack.Dependency.getWarnings(moduleGraph): void
  • moduleGraph {ModuleGraph} module graph
  • Returns: {WebpackError[]} warnings

Returns warnings


webpack.Dependency.serialize(__namedParameters): void
  • __namedParameters {ObjectSerializerContext} context
  • Returns: {void}

webpack.Dependency.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}

webpack.Dependency.updateHash(hash, context): void
  • hash {Hash} hash to be updated
  • context {UpdateHashContextDependency} context
  • Returns: {void}

Update the hash


webpack.Dependency.isLowPriorityDependency(dependency): void
  • dependency {Dependency} dep
  • Returns: <boolean> true if the dependency is a low priority dependency