On this page

Attributes
new Entrypoint(): Entrypoint
Returns:<Entrypoint>
  • asyncEntrypointsIterable {SortableSet}
  • blocksIterable {Iterable} Exposes the group's async dependency blocks as an iterable.
  • childrenIterable {SortableSet}
  • chunks <Chunk[]>
  • debugId <string> Returns a debug-only identifier derived from the group's member chunk debug ids. This is primarily useful in diagnostics and assertions.
  • getModuleIndex <object>
  • getModuleIndex2 <object>
  • groupDebugId <number>
  • id <string> Returns an identifier derived from the ids of the chunks currently in the group.
  • index <number>
  • name <string> | <null> Returns the configured name of the chunk group, if one was assigned. Updates the configured name of the chunk group.
  • options {ChunkGroupOptions}
  • origins {OriginRecord[]}
  • parentsIterable {SortableSet}
addAsyncEntrypoint(entrypoint): boolean
Attributes
entrypoint:<Entrypoint>
Returns:<boolean>

Registers an async entrypoint that is rooted in this chunk group.


addBlock(block): boolean
Attributes
Returns:<boolean>

Associates an async dependency block with this chunk group.


addChild(group): boolean
Attributes
Returns:<boolean>

Adds a child chunk group to the current group.


addDependOn(entrypoint): void
Attributes
entrypoint:<Entrypoint>
Returns:
{void}

addOptions(options): void
  • options {ChunkGroupOptions}
  • Returns: {void}

Merges additional options into the chunk group. Order-based options are combined by taking the higher priority, while unsupported conflicts surface as an explicit error.


addOrigin(module, loc, request): void
Attributes
module:<Module> | <null>
loc:
{DependencyLocation}
request:<string>
Returns:
{void}

Records where this chunk group originated from in user code. The origin is used for diagnostics, ordering, and reporting.


addParent(parentChunk): boolean
Attributes
parentChunk:<ChunkGroup>
Returns:<boolean>

Records a parent chunk group relationship.


checkConstraints(): void
Returns:
{void}

compareTo(chunkGraph, otherGroup): -1 | 0 | 1
Attributes
chunkGraph:<ChunkGraph>
otherGroup:<ChunkGroup>
Returns:
{-1|0|1}

Sorting predicate which allows current ChunkGroup to be compared against another. Sorting values are based off of number of chunks in ChunkGroup.


dependOn(entrypoint): boolean
Attributes
entrypoint:<Entrypoint>
Returns:<boolean>

getBlocks(): AsyncDependenciesBlock[]

Returns the async dependency blocks that create or reference this group.


getChildOrderOptions(childGroup, chunkGraph): Record<string, number>
Attributes
childGroup:<ChunkGroup>
chunkGraph:<ChunkGraph>
Returns:
{Record<string, number>}

Aggregates per-block *Order options for the blocks that bridge this chunk group to the given child chunk group. *Order options are tied to the originating import() call and must not be sourced from the child's shared options, otherwise a webpackPrefetch/Preload directive from one parent would leak into other parents that share the child by name.


getChildren(): ChunkGroup[]

Returns the child chunk groups reachable from this group.


getChildrenByOrders(moduleGraph, chunkGraph): Record<string, ChunkGroup[]>
Attributes
moduleGraph:<ModuleGraph>
chunkGraph:<ChunkGraph>
Returns:
{Record<string, ChunkGroup[]>}

Groups child chunk groups by their *Order options and sorts each group by descending order and deterministic chunk-group comparison.


getEntrypointChunk(): Chunk
Returns:<Chunk>

Returns the chunk which contains the entrypoint modules (or at least the execution of them)


getFiles(): string[]
Returns:<string[]>

Collects the emitted files produced by every chunk in the group.


getModulePostOrderIndex(module): number | undefined
Attributes
module:<Module>

Returns the module's bottom-up traversal index within this group.


getModulePreOrderIndex(module): number | undefined
Attributes
module:<Module>

Returns the module's top-down traversal index within this group.


getNumberOfBlocks(): number
Returns:<number>

getNumberOfChildren(): number
Returns:<number>

getNumberOfParents(): number
Returns:<number>

getParents(): ChunkGroup[]

Returns the parent chunk groups that can lead to this group.


getRuntimeChunk(): Chunk | null
Returns:<Chunk> | <null>

Fetches the chunk reference containing the webpack bootstrap code


hasBlock(block): boolean
Attributes
Returns:<boolean>

Checks whether an async dependency block is associated with this group.


hasParent(parent): boolean
Attributes
Returns:<boolean>

Checks whether the provided group is registered as a parent.


insertChunk(chunk, before): boolean
Attributes
chunk:<Chunk>
before:<Chunk>
Returns:<boolean>

Inserts a chunk directly before another chunk that already belongs to the group, preserving the rest of the ordering.


isInitial(): boolean
Returns:<boolean>

Indicates whether this chunk group is loaded as part of the initial page load instead of being created lazily.


pushChunk(chunk): boolean
Attributes
chunk:<Chunk>
Returns:<boolean>

Appends a chunk to the group when it is not already a member.


remove(): void
Returns:
{void}

Disconnects this group from its parents, children, and chunks. Child groups are reconnected to this group's parents so the surrounding graph remains intact after removal.


removeChild(group): boolean
Attributes
Returns:<boolean>

Removes a child chunk group and clears the corresponding parent link on the removed child.


removeChunk(chunk): boolean
Attributes
chunk:<Chunk>
Returns:<boolean>

Removes a chunk from this group.


removeParent(chunkGroup): boolean
Attributes
chunkGroup:<ChunkGroup>
Returns:<boolean>

Removes a parent chunk group and clears the reverse child relationship.


replaceChunk(oldChunk, newChunk): boolean | undefined
Attributes
oldChunk:<Chunk>
newChunk:<Chunk>

Replaces one member chunk with another while preserving the group's ordering and avoiding duplicates.


setEntrypointChunk(chunk): void
Attributes
chunk:<Chunk>
Returns:
{void}

Sets the chunk with the entrypoint modules for an entrypoint.


setModulePostOrderIndex(module, index): void
Attributes
module:<Module>
index:<number>
Returns:
{void}

Stores the module's bottom-up traversal index within this group.


setModulePreOrderIndex(module, index): void
Attributes
module:<Module>
index:<number>
Returns:
{void}

Stores the module's top-down traversal index within this group.


setRuntimeChunk(chunk): void
Attributes
chunk:<Chunk>
Returns:
{void}

Sets the runtimeChunk for an entrypoint.


sortItems(): void
Returns:
{void}

unshiftChunk(chunk): boolean
Attributes
chunk:<Chunk>
Returns:<boolean>

Moves a chunk to the front of the group or inserts it when it is not already present.