On this page

Source Code: lib/DependenciesBlock.js#L27

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.

Extended by AsyncDependenciesBlock, Module.

new DependenciesBlock(): DependenciesBlock
Source Code: lib/DependenciesBlock.js#L32
Source Code: lib/DependenciesBlock.js#L30
Type:Dependency[]
Source Code: lib/DependenciesBlock.js#L34
dependenciesBlock.addBlock(block): void
Source Code: lib/DependenciesBlock.js#L50
Attributes

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

dependenciesBlock.addDependency(dependency): void
Source Code: lib/DependenciesBlock.js#L61
Attributes
dependency:Dependency

Adds the provided dependency to the dependencies block.

dependenciesBlock.clearDependenciesAndBlocks(): void
Source Code: lib/DependenciesBlock.js#L81

Clear dependencies and blocks.

dependenciesBlock.deserialize(__namedParameters): void
Source Code: lib/DependenciesBlock.js#L114
Attributes

Restores this instance from the provided deserializer context.

dependenciesBlock.getRootBlock(): DependenciesBlock
Source Code: lib/DependenciesBlock.js#L37
dependenciesBlock.removeDependency(dependency): void
Source Code: lib/DependenciesBlock.js#L70
Attributes
dependency:Dependency

Removes dependency.

dependenciesBlock.serialize(__namedParameters): void
Source Code: lib/DependenciesBlock.js#L105
Attributes

Serializes this instance into the provided serializer context.

dependenciesBlock.updateHash(hash, context): void
Source Code: lib/DependenciesBlock.js#L92
Attributes

Updates the hash with the data contributed by this instance.