A Chunk is a unit of encapsulation for Modules. Chunks are "rendered" into bundles that get emitted when the build completes.
new Chunk(name?, backCompat?): Chunk
Creates an instance of Chunk.
stringstring | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string)numberModulebooleanstring | ((pathData: PathDataChunk, assetInfo?: AssetInfo) => string)SortableSet<ChunkGroup>stringSortableSet<string>booleanbooleanstringRuntimeSpecaddGroup(chunkGroup): void
ChunkGroupvoidAdds the provided chunk group to the chunk.
addModule(module): boolean
Adds the provided module to the chunk.
canBeInitial(): boolean
booleanChecks whether it can be initial.
canBeIntegrated(otherChunk): boolean
Checks whether this chunk can be integrated with another chunk.
compareTo(otherChunk): -1 | 0 | 1
Chunk-1 | 0 | 1Compares this chunk with another chunk.
containsModule(module): boolean
Checks whether this chunk contains the module.
disconnectFromGroups(): void
voidDisconnects from groups.
getAllAsyncChunks(): Set<Chunk>
Gets all async chunks.
getAllInitialChunks(): Set<Chunk>
Gets all initial chunks.
getAllReferencedAsyncEntrypoints(): Set<Entrypoint>
Set<Entrypoint>Gets all referenced async entrypoints.
getAllReferencedChunks(): Set<Chunk>
Gets all referenced chunks.
getChildIdsByOrders(chunkGraph, filterFn?): Record<string, ChunkId[]>
ChunkGraph(c: Chunk, chunkGraph: ChunkGraph) => booleanGets child ids by orders.
getChildIdsByOrdersMap(chunkGraph, includeDirectChildren?, filterFn?): ChunkChildIdsByOrdersMapByData
ChunkGraphboolean(c: Chunk, chunkGraph: ChunkGraph) => booleanChunkChildIdsByOrdersMapByDataGets child ids by orders map.
getChildrenOfTypeInOrder(chunkGraph, type): ChunkChildOfTypeInOrder[] | undefined
ChunkGraphstringChunkChildOfTypeInOrder[] | undefinedGets children of type in order.
getChunkMaps(realHash): ChunkMaps
Returns the chunk map information.
getChunkModuleMaps(filterFn): ChunkModuleMaps
ChunkModuleMapsGets chunk module maps.
getEntryOptions(): EntryOptions | undefined
EntryOptions | undefinedGets entry options.
getModules(): Module[]
Module[]Returns the modules for this chunk.
getNumberOfGroups(): number
numberGets number of groups.
getNumberOfModules(): number
numberGets the number of modules in this chunk.
hasAsyncChunks(): boolean
booleanChecks whether this chunk has async chunks.
hasChildByOrder(chunkGraph, type, includeDirectChildren?, filterFn?): boolean
ChunkGraphstringboolean(c: Chunk, chunkGraph: ChunkGraph) => booleanbooleanChecks whether this chunk contains the chunk graph.
hasEntryModule(): boolean
booleanChecks whether this chunk has an entry module.
hasModuleInGraph(filterFn, filterChunkFn?): boolean
Checks whether this chunk contains a matching module in the graph.
hasRuntime(): boolean
booleanChecks whether this chunk has runtime.
integrate(otherChunk): boolean
Integrates another chunk into this chunk when possible.
integratedSize(otherChunk, options): number
ChunkChunkSizeOptionsnumberReturns the integrated size with another chunk.
isEmpty(): boolean
booleanChecks whether this chunk is empty.
isInGroup(chunkGroup): boolean
ChunkGroupbooleanChecks whether this chunk is in group.
isOnlyInitial(): boolean
booleanChecks whether this chunk is only initial.
modulesSize(): number
numberReturns the total size of all modules in this chunk.
moveModule(module, otherChunk): void
Moves a module from this chunk to another chunk.
remove(): void
voidRemoves this chunk from the chunk graph and chunk groups.
removeGroup(chunkGroup): void
ChunkGroupvoidRemoves the provided chunk group from the chunk.
removeModule(module): void
Removes the provided module from the chunk.
size
size(options?): number
ChunkSizeOptionsnumberReturns the estimated size for the requested source type.
split(newChunk): void
Processes the provided new chunk.
updateHash(hash, chunkGraph): void
Updates the hash with the data contributed by this instance.