A Chunk is a unit of encapsulation for Modules. Chunks are "rendered" into bundles that get emitted when the build completes.
Attributes
new Chunk(name?, backCompat?): ChunkAttributes
Returns:
<Chunk>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>idNameHints{SortableSet} ids{ChunkId[]}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>preventIntegration<boolean>rendered<boolean>renderedHash<string>runtime{RuntimeSpec}
webpack.Chunk.addGroup(chunkGroup): voidAttributes
chunkGroup:
<ChunkGroup>the chunkGroup the chunk is being added
Returns:
{void}
webpack.Chunk.addModule(module): booleanAttributes
module:
<Module>the module
Returns:
<boolean>true, if the chunk could be added
webpack.Chunk.canBeInitial(): booleanReturns:
<boolean>whether or not this chunk can be an initial chunk
webpack.Chunk.canBeIntegrated(otherChunk): booleanAttributes
otherChunk:
<Chunk>the other chunk
Returns:
<boolean>true, if chunks could be integrated
webpack.Chunk.compareTo(otherChunk): -1 | 0 | 1Attributes
otherChunk:
<Chunk>the chunk to compare with
Returns:
{-1|0|1} the comparison result
webpack.Chunk.containsModule(module): booleanAttributes
module:
<Module>the module
Returns:
<boolean>true, if the chunk contains the module
webpack.Chunk.disconnectFromGroups(): voidReturns:
{void}
webpack.Chunk.getAllAsyncChunks(): Set<Chunk>Returns:
{Set
} a set of all the async chunks
webpack.Chunk.getAllInitialChunks(): Set<Chunk>Returns:
{Set
} a set of all the initial chunks (including itself)
webpack.Chunk.getAllReferencedAsyncEntrypoints(): Set<Entrypoint>Returns:
{Set
} a set of all the referenced entrypoints
webpack.Chunk.getAllReferencedChunks(): Set<Chunk>Returns:
{Set
} a set of all the referenced chunks (including itself)
webpack.Chunk.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(?)
webpack.Chunk.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
webpack.Chunk.getChildrenOfTypeInOrder(chunkGraph, type): ChunkChildOfTypeInOrder[]Attributes
chunkGraph:
<ChunkGraph>the chunk graph
type:
<string>option name
Returns:
{ChunkChildOfTypeInOrder[]} referenced chunks for a specific type
webpack.Chunk.getChunkMaps(realHash): ChunkMapsAttributes
realHash:
<boolean>whether the full hash or the rendered hash is to be used
Returns:
{ChunkMaps} the chunk map information
webpack.Chunk.getChunkModuleMaps(filterFn): ChunkModuleMapsAttributes
filterFn:
<object>function used to filter modules
Returns:
{ChunkModuleMaps} module map information
webpack.Chunk.getEntryOptions(): EntryOptionsReturns:
<EntryOptions>the entry options for this chunk
webpack.Chunk.getModules(): Module[]Returns:
<Module[]>the modules for this chunk
webpack.Chunk.getNumberOfGroups(): numberReturns:
<number>the amount of groups that the said chunk is in
webpack.Chunk.getNumberOfModules(): numberReturns:
<number>the number of module which are contained in this chunk
webpack.Chunk.hasAsyncChunks(): booleanReturns:
<boolean>true, if the chunk references async chunks
webpack.Chunk.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
webpack.Chunk.hasEntryModule(): booleanReturns:
<boolean>true, if the chunk contains an entry module
webpack.Chunk.hasModuleInGraph(filterFn, filterChunkFn?): booleanAttributes
Returns:
<boolean>return true if module exists in graph
webpack.Chunk.hasRuntime(): booleanReturns:
<boolean>whether or not the Chunk will have a runtime
webpack.Chunk.integrate(otherChunk): booleanAttributes
otherChunk:
<Chunk>the other chunk
Returns:
<boolean>true, if the specified chunk has been integrated
webpack.Chunk.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
webpack.Chunk.isEmpty(): booleanReturns:
<boolean>true, if this chunk contains no module
webpack.Chunk.isInGroup(chunkGroup): booleanAttributes
chunkGroup:
<ChunkGroup>the chunkGroup to check
Returns:
<boolean>returns true if chunk has chunkGroup reference and exists in chunkGroup
webpack.Chunk.isOnlyInitial(): booleanReturns:
<boolean>whether this chunk can only be an initial chunk
webpack.Chunk.modulesSize(): numberReturns:
<number>total size of all modules in this chunk
webpack.Chunk.moveModule(module, otherChunk): voidAttributes
Returns:
{void}
webpack.Chunk.remove(): voidReturns:
{void}
webpack.Chunk.removeGroup(chunkGroup): voidAttributes
chunkGroup:
<ChunkGroup>the chunkGroup the chunk is being removed from
Returns:
{void}
webpack.Chunk.removeModule(module): voidAttributes
module:
<Module>the module
Returns:
{void}
webpack.Chunk.size(options?): voidoptions{ChunkSizeOptions} options object- Returns:
<number>total size of this chunk
webpack.Chunk.split(newChunk): voidAttributes
newChunk:
<Chunk>the new chunk that will be split out of
Returns:
{void}
webpack.Chunk.updateHash(hash, chunkGraph): voidhash{Hash} hash (will be modified)chunkGraph<ChunkGraph>the chunk graph- Returns: {void}