On this page

new ChunkGraph(moduleGraph, hashFunction?): ChunkGraph
Attributes
moduleGraph:ModuleGraph
the module graph
hashFunction:HashFunction
the hash function to use
Returns:ChunkGraph

Creates an instance of ChunkGraph.

Attributes
moduleGraph:ModuleGraph
addChunkRuntimeRequirements(chunk, items): void
Attributes
chunk:Chunk
the chunk
items:Set<string>
runtime requirements to be added (ownership of this Set is given to ChunkGraph)
Returns:void

Adds chunk runtime requirements.


addDependentHashModuleToChunk(chunk, module): void
Attributes
chunk:Chunk
the new chunk
the module that require a full hash
Returns:void

Adds dependent hash module to chunk.


addFullHashModuleToChunk(chunk, module): void
Attributes
chunk:Chunk
the new chunk
the module that require a full hash
Returns:void

Adds full hash module to chunk.


addModuleRuntimeRequirements(module, runtime, items, transferOwnership?): void
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
items:Set<string>
runtime requirements to be added (ownership of this Set is given to ChunkGraph when transferOwnership not false)
transferOwnership:boolean
true: transfer ownership of the items object, false: items is immutable and shared and won't be modified
Returns:void

Adds module runtime requirements.


addTreeRuntimeRequirements(chunk, items): void
Attributes
chunk:Chunk
the chunk
runtime requirements to be added
Returns:void

Adds tree runtime requirements.


attachDependentHashModules(chunk, modules): void
Attributes
chunk:Chunk
the chunk
the modules that require a full hash
Returns:void

Attach dependent hash modules.


attachFullHashModules(chunk, modules): void
Attributes
chunk:Chunk
the chunk
the modules that require a full hash
Returns:void

Attach full hash modules.


attachModules(chunk, modules): void
Attributes
chunk:Chunk
the chunk
modules:Iterable<Module>
the modules
Returns:void

Processes the provided chunk.


attachRuntimeModules(chunk, modules): void
Attributes
chunk:Chunk
the chunk
the runtime modules
Returns:void

Attach runtime modules.


canChunksBeIntegrated(chunkA, chunkB): boolean
Attributes
chunkA:Chunk
chunk
chunkB:Chunk
chunk
Returns:boolean
true, if chunks could be integrated

Checks whether it can chunks be integrated.


compareChunks(chunkA, chunkB): -1 | 0 | 1
Attributes
chunkA:Chunk
first chunk
chunkB:Chunk
second chunk
Returns:-1 | 0 | 1
this is a comparator function like sort and returns -1, 0, or 1 based on sort order

Compares the provided values and returns their ordering.


connectBlockAndChunkGroup(depBlock, chunkGroup): void
Attributes
the async block
chunkGroup:ChunkGroup
the chunk group
Returns:void

Connects block and chunk group.


connectChunkAndEntryModule(chunk, module, entrypoint): void
Attributes
chunk:Chunk
the new chunk
module:Module
the entry module
entrypoint:Entrypoint
the chunk group which must be loaded before the module is executed
Returns:void

Connects chunk and entry module.


connectChunkAndModule(chunk, module): void
Attributes
chunk:Chunk
the new chunk
module:Module
the module
Returns:void

Connects chunk and module.


connectChunkAndRuntimeModule(chunk, module): void
Attributes
chunk:Chunk
the new chunk
the runtime module
Returns:void

Connects chunk and runtime module.


disconnectChunk(chunk): void
Attributes
chunk:Chunk
the chunk which will be disconnected
Returns:void

Processes the provided chunk.


disconnectChunkAndEntryModule(chunk, module): void
Attributes
chunk:Chunk
the new chunk
module:Module
the entry module
Returns:void

Disconnects chunk and entry module.


disconnectChunkAndModule(chunk, module): void
Attributes
chunk:Chunk
the chunk
module:Module
the module
Returns:void

Disconnects chunk and module.


disconnectChunkAndRuntimeModule(chunk, module): void
Attributes
chunk:Chunk
the new chunk
the runtime module
Returns:void

Disconnects chunk and runtime module.


disconnectChunkGroup(chunkGroup): void
Attributes
chunkGroup:ChunkGroup
the chunk group
Returns:void

Disconnects chunk group.


disconnectEntries(chunk): void
Attributes
chunk:Chunk
the chunk, for which all entries will be removed
Returns:void

Disconnects entries.


disconnectEntryModule(module): void
Attributes
module:Module
the entry module, it will no longer be entry
Returns:void

Disconnects entry module.


getBlockChunkGroup(depBlock): ChunkGroup | undefined
Attributes
the async block
the chunk group

Gets block chunk group.


getChunkConditionMap(chunk, filterFn): ChunkConditionMap
Attributes
chunk:Chunk
the chunk
filterFn:(c: Chunk, chunkGraph: ChunkGraph) => boolean
function used to filter chunks
chunk condition map

Gets chunk condition map.


getChunkDependentHashModulesIterable(chunk): Iterable<RuntimeModule, any, any> | undefined
Attributes
chunk:Chunk
the chunk
iterable of modules (do not modify)

Gets chunk dependent hash modules iterable.


getChunkEntryDependentChunksIterable(chunk): Iterable<Chunk>
Attributes
chunk:Chunk
the chunk
Returns:Iterable<Chunk>
iterable of chunks

Gets chunk entry dependent chunks iterable.


getChunkEntryModulesIterable(chunk): Iterable<Module>
Attributes
chunk:Chunk
the chunk
Returns:Iterable<Module>
iterable of modules (do not modify)

Gets chunk entry modules iterable.


getChunkEntryModulesWithChunkGroupIterable(chunk): Iterable<[Module, Entrypoint | undefined]>
Attributes
chunk:Chunk
the chunk
iterable of modules (do not modify)

Gets chunk entry modules with chunk group iterable.


getChunkFullHashModulesIterable(chunk): Iterable<RuntimeModule, any, any> | undefined
Attributes
chunk:Chunk
the chunk
iterable of modules (do not modify)

Gets chunk full hash modules iterable.


getChunkFullHashModulesSet(chunk): ReadonlySet<RuntimeModule> | undefined
Attributes
chunk:Chunk
the chunk
Returns:ReadonlySet<RuntimeModule> | undefined
set of modules (do not modify)

Gets chunk full hash modules set.


getChunkModuleIdMap(chunk, filterFn, includeAllChunks?): ChunkModuleIdMapEs5Alias_2
Attributes
chunk:Chunk
the chunk
filterFn:(m: Module) => boolean
function used to filter modules
includeAllChunks:boolean
all chunks or only async chunks
chunk to module ids object

Gets chunk module id map.


getChunkModuleRenderedHashMap(chunk, filterFn, hashLength?, includeAllChunks?): ChunkModuleHashMap
Attributes
chunk:Chunk
the chunk
filterFn:(m: Module) => boolean
function used to filter modules
hashLength:number
length of the hash
includeAllChunks:boolean
all chunks or only async chunks
chunk to module id to module hash object

Gets chunk module rendered hash map.


getChunkModules(chunk): Module[]
Attributes
chunk:Chunk
the chunk
Returns:Module[]
return the modules for this chunk (cached, do not modify)

Gets chunk modules.


getChunkModulesIterable(chunk): Iterable<Module>
Attributes
chunk:Chunk
the chunk
Returns:Iterable<Module>
return the modules for this chunk

Gets chunk modules iterable.


getChunkModulesIterableBySourceType(chunk, sourceType): Iterable<Module, any, any> | undefined
Attributes
chunk:Chunk
the chunk
sourceType:string
source type
return the modules for this chunk

Gets chunk modules iterable by source type.


getChunkModuleSourceTypes(chunk, module): ReadonlySet<string>
Attributes
chunk:Chunk
chunk
module:Module
chunk module
Returns:ReadonlySet<string>
source types

Gets chunk module source types.


getChunkModulesSize(chunk): number
Attributes
chunk:Chunk
the chunk
Returns:number
total size of all modules in the chunk

Gets chunk modules size.


getChunkModulesSizes(chunk): Record<string, number>
Attributes
chunk:Chunk
the chunk
Returns:Record<string, number>
total sizes of all modules in the chunk by source type

Gets chunk modules sizes.


getChunkRootModules(chunk): Module[]
Attributes
chunk:Chunk
the chunk
Returns:Module[]
root modules of the chunks (ordered by identifier)

Gets chunk root modules.


getChunkRuntimeModulesInOrder(chunk): RuntimeModule[]
Attributes
chunk:Chunk
the chunk
Returns:RuntimeModule[]
array of modules in order of execution

Gets chunk runtime modules in order.


getChunkRuntimeModulesIterable(chunk): Iterable<RuntimeModule>
Attributes
chunk:Chunk
the chunk
iterable of modules (do not modify)

Gets chunk runtime modules iterable.


getChunkRuntimeRequirements(chunk): ReadonlySet<string>
Attributes
chunk:Chunk
the chunk
Returns:ReadonlySet<string>
runtime requirements

Gets chunk runtime requirements.


getChunkSize(chunk, options?): number
Attributes
chunk:Chunk
the chunk
options object
Returns:number
total size of the chunk

Returns total size of the chunk.


getIntegratedChunksSize(chunkA, chunkB, options?): number
Attributes
chunkA:Chunk
chunk
chunkB:Chunk
chunk
options object
Returns:number
total size of the chunk or false if chunks can't be integrated

Gets integrated chunks size.


getModuleChunks(module): Chunk[]
Attributes
module:Module
the module
Returns:Chunk[]
array of chunks (cached, do not modify)

Gets module chunks.


getModuleChunksIterable(module): Iterable<Chunk>
Attributes
module:Module
the module
Returns:Iterable<Chunk>
iterable of chunks (do not modify)

Gets module chunks iterable.


getModuleGraphHash(module, runtime, withConnections?): string
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
withConnections:boolean
include connections
Returns:string
hash

Gets module graph hash.


getModuleGraphHashBigInt(module, runtime, withConnections?): bigint
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
withConnections:boolean
include connections
Returns:bigint
hash

Gets module graph hash big int.


getModuleHash(module, runtime): string
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
Returns:string
hash

Returns hash.


getModuleId(module): string | number | null
Attributes
module:Module
the module
Returns:string | number | null
the id of the module

Returns the id of the module.


getModuleRuntimeRequirements(module, runtime): ReadonlySet<string>
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
Returns:ReadonlySet<string>
runtime requirements

Gets module runtime requirements.


getModuleRuntimes(module): RuntimeSpecSet
Attributes
module:Module
the module
runtimes

Gets module runtimes.


getModuleSourceTypes(module): ReadonlySet<string>
Attributes
module:Module
module
Returns:ReadonlySet<string>
source types

Gets module source types.


getNumberOfChunkFullHashModules(chunk): number
Attributes
chunk:Chunk
the chunk
Returns:number
the number of full hash modules which are contained in this chunk

Gets number of chunk full hash modules.


getNumberOfChunkModules(chunk): number
Attributes
chunk:Chunk
the chunk
Returns:number
the number of modules which are contained in this chunk

Gets number of chunk modules.


getNumberOfEntryModules(chunk): number
Attributes
chunk:Chunk
the chunk
Returns:number
the amount of entry modules in chunk

Gets number of entry modules.


getNumberOfModuleChunks(module): number
Attributes
module:Module
the module
Returns:number
the number of chunk which contain the module

Gets number of module chunks.


getNumberOfRuntimeModules(chunk): number
Attributes
chunk:Chunk
the chunk
Returns:number
the amount of entry modules in chunk

Gets number of runtime modules.


getOrderedChunkModules(chunk, comparator): Module[]
Attributes
chunk:Chunk
the chunk
comparator:(a: Module, b: Module) => -1 | 0 | 1
comparator function
Returns:Module[]
return the modules for this chunk (cached, do not modify)

Gets ordered chunk modules.


getOrderedChunkModulesIterable(chunk, comparator): Iterable<Module>
Attributes
chunk:Chunk
the chunk
comparator:(a: Module, b: Module) => -1 | 0 | 1
comparator function
Returns:Iterable<Module>
return the modules for this chunk

Gets ordered chunk modules iterable.


getOrderedChunkModulesIterableBySourceType(chunk, sourceType, comparator): Iterable<Module, any, any> | undefined
Attributes
chunk:Chunk
the chunk
sourceType:string
source type
comparator:(a: Module, b: Module) => -1 | 0 | 1
comparator function
return the modules for this chunk

Gets ordered chunk modules iterable by source type.


getOrderedModuleChunksIterable(module, sortFn): Iterable<Chunk>
Attributes
module:Module
the module
sortFn:(a: Chunk, b: Chunk) => -1 | 0 | 1
sort function
Returns:Iterable<Chunk>
iterable of chunks (do not modify)

Gets ordered module chunks iterable.


getRenderedModuleHash(module, runtime): string
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
Returns:string
hash

Gets rendered module hash.


getRuntimeChunkDependentChunksIterable(chunk): Iterable<Chunk>
Attributes
chunk:Chunk
the chunk
Returns:Iterable<Chunk>
iterable of chunks and include chunks from children entrypoints

Gets runtime chunk dependent chunks iterable.


getRuntimeId(runtime): RuntimeId
Attributes
runtime:string
runtime
Returns:RuntimeId
the id of the runtime

Returns the id of the runtime.


getTreeRuntimeRequirements(chunk): ReadonlySet<string>
Attributes
chunk:Chunk
the chunk
Returns:ReadonlySet<string>
runtime requirements

Gets tree runtime requirements.


hasChunkEntryDependentChunks(chunk): boolean
Attributes
chunk:Chunk
the chunk
Returns:boolean
true, when it has dependent chunks

Checks whether this chunk graph contains the chunk.


hasModuleHashes(module, runtime): boolean
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
Returns:boolean
true, if the module has hashes for this runtime

Checks whether this chunk graph contains the module.


hasModuleInGraph(chunk, filterFn, filterChunkFn?): boolean
Attributes
chunk:Chunk
the chunk
filterFn:(m: Module) => boolean
predicate function used to filter modules
filterChunkFn:(c: Chunk, chunkGraph: ChunkGraph) => boolean
predicate function used to filter chunks
Returns:boolean
return true if module exists in graph

Checks whether this chunk graph contains the chunk.


integrateChunks(chunkA, chunkB): void
Attributes
chunkA:Chunk
the target chunk
chunkB:Chunk
the chunk to integrate
Returns:void

Processes the provided chunk a.


isEntryModule(module): boolean
Attributes
module:Module
the checked module
Returns:boolean
true, if the module is entry of any chunk

Checks whether this chunk graph is entry module.


isEntryModuleInChunk(module, chunk): boolean
Attributes
module:Module
the checked module
chunk:Chunk
the checked chunk
Returns:boolean
true, if the chunk contains the module as entry

Checks whether this chunk graph is entry module in chunk.


isModuleInChunk(module, chunk): boolean
Attributes
module:Module
the checked module
chunk:Chunk
the checked chunk
Returns:boolean
true, if the chunk contains the module

Checks whether this chunk graph is module in chunk.


isModuleInChunkGroup(module, chunkGroup): boolean
Attributes
module:Module
the checked module
chunkGroup:ChunkGroup
the checked chunk group
Returns:boolean
true, if the chunk contains the module

Checks whether this chunk graph is module in chunk group.


replaceModule(oldModule, newModule): void
Attributes
oldModule:Module
the replaced module
newModule:Module
the replacing module
Returns:void

Processes the provided old module.


setChunkModuleSourceTypes(chunk, module, sourceTypes): void
Attributes
chunk:Chunk
chunk
module:Module
chunk module
sourceTypes:ReadonlySet<string>
source types
Returns:void

Sets chunk module source types.


setModuleHashes(module, runtime, hash, renderedHash): void
Attributes
module:Module
the module
runtime:RuntimeSpec
the runtime
hash:string
the full hash
renderedHash:string
the shortened hash for rendering
Returns:void

Sets module hashes.


setModuleId(module, id): void
Attributes
module:Module
the module
the id of the module
Returns:void

Updates module id using the provided module.


setRuntimeId(runtime, id): void
Attributes
runtime:string
runtime
the id of the runtime
Returns:void

Updates runtime id using the provided runtime.


upgradeDependentToFullHashModules(chunk): void
Attributes
chunk:Chunk
the chunk to upgrade
Returns:void

Upgrade dependent to full hash modules.


Attributes
chunk:Chunk
the chunk
Returns:void

Clear chunk graph for chunk.


Attributes
module:Module
the module
Returns:void

Clear chunk graph for module.


Attributes
chunk:Chunk
the chunk
deprecateMessage:string
message for the deprecation message
deprecationCode:string
code for the deprecation
Returns:ChunkGraph
the chunk graph

Gets chunk graph for chunk.


Attributes
module:Module
the module
deprecateMessage:string
message for the deprecation message
deprecationCode:string
code for the deprecation
Returns:ChunkGraph
the chunk graph

Gets chunk graph for module.


Attributes
chunk:Chunk
the chunk
chunkGraph:ChunkGraph
the chunk graph
Returns:void

Sets chunk graph for chunk.


Attributes
module:Module
the module
chunkGraph:ChunkGraph
the chunk graph
Returns:void

Sets chunk graph for module.





Type:string | number