On this page

class webpack.esm.ModuleChunkLoadingRuntimeModule extends RuntimeModule
new ModuleChunkLoadingRuntimeModule(runtimeRequirements): ModuleChunkLoadingRuntimeModule
Attributes
runtimeRequirements:ReadonlySet<string>
runtime requirements

Creates an instance of ModuleChunkLoadingRuntimeModule.

Attributes
buildInfo:BuildInfo
buildMeta:BuildMeta
chunk:Chunk
chunkGraph:ChunkGraph
chunksIterable:Iterable<Chunk>
codeGenerationDependencies:Dependency[]
compilation:Compilation
context:string | null
debugId:number
dependencies:Dependency[]
dependentHash:boolean
depth:number | null
Returns the depth. Updates the depth using the provided value.
errors:any
exportsArgument:string
Gets exports argument.
factoryMeta:FactoryMeta
fullHash:boolean
hasEqualsChunks:any
hash:string
Returns the hash of the module.
id:string | number | null
Returns the module id assigned by the chunk graph. Updates the module id using the provided value.
index:number | null
Returns the pre-order index. Updates the pre-order index using the provided value.
index2:number | null
Returns the post-order index. Updates the post-order index using the provided value.
issuer:Module | null
Returns the issuer. Updates the issuer using the provided value.
isUsed:any
layer:string | null
moduleArgument:string
Gets module argument.
name:string
needId:boolean
optimizationBailout:(string | ((requestShortener: RequestShortener) => string))[]
Gets optimization bailout.
optional:boolean
presentationalDependencies:Dependency[]
renderedHash:string
Returns the rendered hash of the module.
resolveOptions:ResolveOptions
stage:number
type:string
used:any
usedExports:boolean | SortableSet<string> | null
useSimpleSourceMap:boolean
useSourceMap:boolean
warnings:any
STAGE_ATTACH:number
Runtime modules which attach to handlers of other runtime modules
STAGE_BASIC:number
Runtime modules with simple dependencies on other runtime modules
STAGE_NORMAL:number
Runtime modules without any dependencies to other runtime modules
STAGE_TRIGGER:number
Runtime modules which trigger actions on bootstrap
addBlock(block): void
Attributes

Adds a DependencyBlock to DependencyBlock relationship. This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)


addCacheDependencies(fileDependencies, contextDependencies, missingDependencies, buildDependencies): void
Attributes
fileDependencies:LazySet<string>
contextDependencies:LazySet<string>
missingDependencies:LazySet<string>
buildDependencies:LazySet<string>
Returns:void

Adds the provided file dependencies to the module.


addChunk(chunk): boolean
Stability: 0Deprecated
Attributes
chunk:Chunk
Returns:boolean

Adds the provided chunk to the module.


addCodeGenerationDependency(codeGenerationDependency): void
Attributes
codeGenerationDependency:Dependency
Returns:void

Adds code generation dependency.


addDependency(dependency): void
Attributes
dependency:Dependency
Returns:void

Adds the provided dependency to the dependencies block.


addError(error): void
Attributes
error:Error
Returns:void

Adds the provided error to the module.


addPresentationalDependency(presentationalDependency): void
Attributes
presentationalDependency:Dependency
Returns:void

Adds presentational dependency.


addWarning(warning): void
Attributes
warning:Error
Returns:void

Adds the provided warning to the module.


attach(compilation, chunk, chunkGraph?): void
Attributes
compilation:Compilation
chunk:Chunk
chunkGraph:ChunkGraph
Returns:void

Processes the provided compilation.


build(options, compilation, resolver, fs, callback): void
Attributes

Builds the module using the provided compilation context.


chunkCondition(chunk, compilation): boolean
Attributes
chunk:Chunk
compilation:Compilation
Returns:boolean

Returns true if the module can be placed in the chunk.


cleanupForCache(): void
Returns:void

Assuming this module is in the cache. Remove internal references to allow freeing some memory.


clearDependenciesAndBlocks(): void
Returns:void

Clear dependencies and blocks.


clearWarningsAndErrors(): void
Returns:void

removes all warnings and errors


codeGeneration(context): CodeGenerationResult
Attributes

Generates code and runtime requirements for this module.


deserialize(objectDeserializerContext): void
Attributes
objectDeserializerContext:ObjectDeserializerContext
Returns:void

Restores this instance from the provided deserializer context.


generate(): string | null
Returns:string | null
runtime code

Generates runtime code for this runtime module.


getChunks(): Chunk[]
Stability: 0Deprecated
Returns:Chunk[]

getConcatenationBailoutReason(context): string | undefined
Attributes

Returns the reason this module cannot be concatenated, when one exists.


getErrors(): Error[] | undefined
Returns:Error[] | undefined

Returns list of errors if any.


getExportsType(moduleGraph, strict?): ExportsType
Attributes
moduleGraph:ModuleGraph
strict:boolean
Returns:ExportsType

Returns export type.


getGeneratedCode(): string | null
Returns:string | null

Gets generated code.


getNumberOfChunks(): number
Stability: 0Deprecated
Returns:number

getNumberOfErrors(): number
Returns:number

Gets number of errors.


getNumberOfWarnings(): number
Returns:number

Gets number of warnings.


getRootBlock(): DependenciesBlock

getSideEffectsConnectionState(moduleGraph): ConnectionState
Attributes
moduleGraph:ModuleGraph

Gets side effects connection state.


getSourceBasicTypes(): ReadonlySet<string>
Returns:ReadonlySet<string>

Basic source types are high-level categories like javascript, css, webassembly, etc. We only have built-in knowledge about the javascript basic type here; other basic types may be added or changed over time by generators and do not need to be handled or detected here. Some modules, e.g. RemoteModule, may return non-basic source types like "remote" and "share-init" from getSourceTypes(), but their generated output is still JavaScript, i.e. their basic type is JS.


getSourceTypes(): ReadonlySet<string>
Returns:ReadonlySet<string>

Returns the source types this module can generate.


getUnsafeCacheData(): UnsafeCacheData

Module should be unsafe cached. Get data that's needed for that. This data will be passed to restoreFromUnsafeCache later.


getWarnings(): Error[] | undefined
Returns:Error[] | undefined

Returns list of warnings if any.


hasChunkCondition(): boolean
Returns:boolean

hasReasonForChunk(chunk, moduleGraph, chunkGraph): boolean
Attributes
chunk:Chunk
moduleGraph:ModuleGraph
chunkGraph:ChunkGraph
Returns:boolean

Checks whether this module contains the chunk.


hasReasons(moduleGraph, runtime): boolean
Attributes
moduleGraph:ModuleGraph
runtime:RuntimeSpec
Returns:boolean

Checks whether this module contains the module graph.


identifier(): string
Returns:string

Returns the unique identifier used to reference this module.


invalidateBuild(): void
Returns:void

Invalidates the cached state associated with this value.


isAccessibleInChunk(chunkGraph, chunk, ignoreChunk?): boolean
Attributes
chunkGraph:ChunkGraph
chunk:Chunk
ignoreChunk:Chunk
Returns:boolean

Checks whether this module is accessible in chunk.


isAccessibleInChunkGroup(chunkGraph, chunkGroup, ignoreChunk?): boolean
Attributes
chunkGraph:ChunkGraph
chunkGroup:ChunkGroup
ignoreChunk:Chunk
Returns:boolean

Checks whether this module is accessible in chunk group.


isEntryModule(): boolean
Stability: 0Deprecated
Returns:boolean

isInChunk(chunk): boolean
Stability: 0Deprecated
Attributes
chunk:Chunk
Returns:boolean

Checks whether this module is in the provided chunk.


isOptional(moduleGraph): boolean
Attributes
moduleGraph:ModuleGraph
Returns:boolean

Checks whether this module is optional.


isProvided(exportName): boolean | null
Stability: 0Deprecated
Attributes
exportName:string
Returns:boolean | null

Checks whether this module provides the specified export.


libIdent(options): string | null
Attributes
Returns:string | null

Gets the library identifier.


nameForCondition(): string | null
Returns:string | null

Returns the path used when matching this module against rule conditions.


needBuild(context, callback): void
Attributes
callback:(err?: WebpackError | null, needBuild?: boolean) => void
Returns:void

Checks whether the module needs to be rebuilt for the current build state.


needRebuild(fileTimestamps, contextTimestamps): boolean
Stability: 0Deprecated: Use needBuild instead
Attributes
fileTimestamps:Map<string, number | null>
contextTimestamps:Map<string, number | null>
Returns:boolean

Checks whether it needs rebuild.


originalSource(): Source | null
Returns:Source | null

Gets the original source.


readableIdentifier(requestShortener): string
Attributes
requestShortener:RequestShortener
Returns:string

Returns a human-readable identifier for this module.


removeChunk(chunk): void
Stability: 0Deprecated
Attributes
chunk:Chunk
Returns:void

Removes the provided chunk from the module.


removeDependency(dependency): void
Attributes
dependency:Dependency
Returns:void

Removes dependency.


serialize(objectSerializerContext): void
Attributes
objectSerializerContext:ObjectSerializerContext
Returns:void

Serializes this instance into the provided serializer context.


shouldIsolate(): boolean
Returns:boolean

Returns true, if the runtime module should get it's own scope.


size(type?): number
Attributes
type:string
Returns:number

Returns the estimated size for the requested source type.


source(dependencyTemplates, runtimeTemplate, type?): Source
Stability: 0Deprecated: Use codeGeneration() instead
Attributes
dependencyTemplates:DependencyTemplates
runtimeTemplate:RuntimeTemplate
type:string
Returns:Source

Returns generated source.


updateCacheModule(module): void
Attributes
module:Module
Returns:void

Assuming this module is in the cache. Update the (cached) module with the fresh module from the factory. Usually updates internal references and properties.


updateHash(hash, context): void
Attributes

Updates the hash with the data contributed by this instance.


Attributes
compilation:Compilation
the compilation

Returns hooks.


Stability: 0Deprecated: In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method.
Attributes
module:Module
Returns:ReadonlySet<string>

Gets source basic types.