On this page

DependenciesBlock is the base class for all Module classes in webpack. It describes a "block" of dependencies which are pointers to other DependenciesBlock instances. For example when a Module has a CommonJs require statement, the DependencyBlock for the CommonJs module would be added as a dependency to the Module. DependenciesBlock is inherited by two types of classes: Module subclasses and AsyncDependenciesBlock subclasses. The only difference between the two is that AsyncDependenciesBlock subclasses are used for code-splitting (async boundary) and Module subclasses are not.

new DependenciesBlock(): DependenciesBlock
Attributes
addBlock(block): void
Attributes

Adds a DependencyBlock to DependencyBlock relationship. This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)


addDependency(dependency): void
Attributes
dependency:Dependency
Returns:void

Adds the provided dependency to the dependencies block.


clearDependenciesAndBlocks(): void
Returns:void

Clear dependencies and blocks.


deserialize(objectDeserializerContextObjectMiddlewareObject_4): void
Attributes
objectDeserializerContextObjectMiddlewareObject_4:ObjectDeserializerContextObjectMiddlewareObject_4
Returns:void

Restores this instance from the provided deserializer context.


getRootBlock(): DependenciesBlock

removeDependency(dependency): void
Attributes
dependency:Dependency
Returns:void

Removes dependency.


serialize(objectSerializerContextObjectMiddlewareObject_5): void
Attributes
objectSerializerContextObjectMiddlewareObject_5:ObjectSerializerContextObjectMiddlewareObject_5
Returns:void

Serializes this instance into the provided serializer context.


updateHash(hash, context): void
Attributes

Updates the hash with the data contributed by this instance.