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