A Chunk is a unit of encapsulation for Modules. Chunks are "rendered" into bundles that get emitted when the build completes.
Attributes
new HotUpdateChunk(): HotUpdateChunkReturns:
<HotUpdateChunk>auxiliaryFiles{Set} chunkReason<string>contentHash{Record<string, string>}cssFilenameTemplate<string>|<object>debugId<number>entryModule<Module>extraAsync<boolean>filenameTemplate<string>|<object>files{Set} groupsIterable{SortableSet} hash<string>id<string>|<number>|<null>idNameHints{SortableSet} ids<null>modulesIterable{Iterable} A Chunk is a unit of encapsulation for Modules. Chunks are "rendered" into bundles that get emitted when the build completes. name<string>|<null>preventIntegration<boolean>rendered<boolean>renderedHash<string>runtime{RuntimeSpec}
addGroup(chunkGroup): voidAttributes
chunkGroup:
<ChunkGroup>the chunkGroup the chunk is being added
Returns:
{void}
addModule(module): booleanAttributes
module:
<Module>the module
Returns:
<boolean>true, if the chunk could be added
canBeInitial(): booleanReturns:
<boolean>whether or not this chunk can be an initial chunk
canBeIntegrated(otherChunk): booleanAttributes
otherChunk:
<Chunk>the other chunk
Returns:
<boolean>true, if chunks could be integrated
compareTo(otherChunk): -1 | 0 | 1Attributes
otherChunk:
<Chunk>the chunk to compare with
Returns:
{-1|0|1} the comparison result
containsModule(module): booleanAttributes
module:
<Module>the module
Returns:
<boolean>true, if the chunk contains the module
disconnectFromGroups(): voidReturns:
{void}
getAllAsyncChunks(): Set<Chunk>Returns:
{Set
} a set of all the async chunks
getAllInitialChunks(): Set<Chunk>Returns:
{Set
} a set of all the initial chunks (including itself)
getAllReferencedAsyncEntrypoints(): Set<Entrypoint>Returns:
{Set
} a set of all the referenced entrypoints
getAllReferencedChunks(): Set<Chunk>Returns:
{Set
} a set of all the referenced chunks (including itself)
getChildIdsByOrders(chunkGraph, filterFn?): Record<string, ChunkId[]>Attributes
chunkGraph:
<ChunkGraph>the chunk graph
filterFn:
<object>function used to filter chunks
Returns:
{Record<string, ChunkId[]>} a record object of names to lists of child ids(?)
getChildIdsByOrdersMap(chunkGraph, includeDirectChildren?, filterFn?): ChunkChildIdsByOrdersMapByDataAttributes
chunkGraph:
<ChunkGraph>the chunk graph
includeDirectChildren:
<boolean>include direct children (by default only children of async children are included)
filterFn:
<object>function used to filter chunks
Returns:
{ChunkChildIdsByOrdersMapByData} a record object of names to lists of child ids(?) by chunk id
getChildrenOfTypeInOrder(chunkGraph, type): undefinedAttributes
chunkGraph:
<ChunkGraph>the chunk graph
type:
<string>option name
Returns:
<undefined>referenced chunks for a specific type
getChunkMaps(realHash): ChunkMapsStability: 0Deprecated
Attributes
realHash:
<boolean>Returns:
{ChunkMaps}
getChunkModuleMaps(filterFn): ChunkModuleMapsAttributes
filterFn:
<object>function used to filter modules
Returns:
{ChunkModuleMaps} module map information
getEntryOptions(): EntryOptions | undefinedReturns:
<EntryOptions>
|
<undefined>the entry options for this chunk
getModules(): Module[]Returns:
<Module[]>the modules for this chunk
getNumberOfGroups(): numberReturns:
<number>the amount of groups that the said chunk is in
getNumberOfModules(): numberReturns:
<number>the number of module which are contained in this chunk
hasAsyncChunks(): booleanReturns:
<boolean>true, if the chunk references async chunks
hasChildByOrder(chunkGraph, type, includeDirectChildren?, filterFn?): booleanAttributes
chunkGraph:
<ChunkGraph>the chunk graph
type:
<string>option name
includeDirectChildren:
<boolean>include direct children (by default only children of async children are included)
filterFn:
<object>function used to filter chunks
Returns:
<boolean>true when the child is of type order, otherwise false
hasEntryModule(): booleanReturns:
<boolean>true, if the chunk contains an entry module
hasModuleInGraph(filterFn, filterChunkFn?): booleanAttributes
Returns:
<boolean>return true if module exists in graph
hasRuntime(): booleanReturns:
<boolean>whether or not the Chunk will have a runtime
integrate(otherChunk): booleanAttributes
otherChunk:
<Chunk>the other chunk
Returns:
<boolean>true, if the specified chunk has been integrated
integratedSize(otherChunk, options): numberAttributes
otherChunk:
<Chunk>the other chunk
options:
{ChunkSizeOptions} options object
Returns:
<number>total size of the chunk or false if the chunk can't be integrated
isEmpty(): booleanReturns:
<boolean>true, if this chunk contains no module
isInGroup(chunkGroup): booleanAttributes
chunkGroup:
<ChunkGroup>the chunkGroup to check
Returns:
<boolean>returns true if chunk has chunkGroup reference and exists in chunkGroup
isOnlyInitial(): booleanReturns:
<boolean>whether this chunk can only be an initial chunk
modulesSize(): numberReturns:
<number>total size of all modules in this chunk
moveModule(module, otherChunk): voidAttributes
Returns:
{void}
remove(): voidReturns:
{void}
removeGroup(chunkGroup): voidAttributes
chunkGroup:
<ChunkGroup>the chunkGroup the chunk is being removed from
Returns:
{void}
removeModule(module): voidAttributes
module:
<Module>the module
Returns:
{void}
M
size
size(options?): voidoptions{ChunkSizeOptions} options object- Returns:
<number>total size of this chunk
split(newChunk): voidAttributes
newChunk:
<Chunk>the new chunk that will be split out of
Returns:
{void}
updateHash(hash, chunkGraph): voidhash{Hash} hash (will be modified)chunkGraph<ChunkGraph>the chunk graph- Returns: {void}