On this page

Attributes
new CssLoadingRuntimeModule(runtimeRequirements): void
Attributes
buildInfo:
{BuildInfo}
buildMeta:
{BuildMeta}
chunk:<Chunk>
chunkGraph:<ChunkGraph>
chunksIterable:
{Iterable }
codeGenerationDependencies:<Dependency[]>
compilation:<Compilation>
context:<string> | <null>
debugId:<number>
dependencies:<Dependency[]>
dependentHash:<boolean>
Returns the depth. Updates the depth using the provided value.
errors:<any>
exportsArgument:<string>
Gets exports argument.
factoryMeta:
{FactoryMeta}
fullHash:<boolean>
hasEqualsChunks:<any>
Returns the hash of the module.
Returns the module id assigned by the chunk graph. Updates the module id using the provided value.
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>
moduleArgument:<string>
Gets module argument.
needId:<boolean>
optimizationBailout:<string> | <object[]>
Gets optimization bailout.
optional:<boolean>
parent:
{DependenciesBlock}
presentationalDependencies:<Dependency[]>
profile:
{ModuleProfile}
renderedHash:<string>
Returns the rendered hash of the module.
resolveOptions:<ResolveOptions>
stage:<number>
used:<any>
usedExports:
{boolean|SortableSet |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
Returns:
{void}

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
  • fileDependencies {LazySet}
  • contextDependencies {LazySet}
  • missingDependencies {LazySet}
  • buildDependencies {LazySet}
  • 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

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): void
  • context {CodeGenerationContext}
  • Returns: {CodeGenerationResult}

Generates code and runtime requirements for this module.


deserialize(__namedParameters): void
Attributes
__namedParameters:<ObjectDeserializerContext>
Returns:
{void}

Restores this instance from the provided deserializer context.


generate(): string | null
Returns:<string> | <null>

Generates runtime code for this runtime module.


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

getConcatenationBailoutReason(context): void

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


getErrors(): 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
Returns:
{DependenciesBlock}

getSideEffectsConnectionState(moduleGraph): ConnectionState
Attributes
moduleGraph:<ModuleGraph>
Returns:
{ConnectionState}

Gets side effects connection state.


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

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 }

Returns the source types this module can generate.


getUnsafeCacheData(): UnsafeCacheData
Returns:
{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 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): void

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
  • context {NeedBuildContext}
  • callback <object>
  • Returns: {void}

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


needRebuild(fileTimestamps, contextTimestamps): void
Stability: 0Deprecated: Use needBuild instead
  • 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): void
  • 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(__namedParameters): void
Attributes
__namedParameters:<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
Returns:<number>

Returns the estimated size for the requested source type.


source(dependencyTemplates, runtimeTemplate, type?): void
Stability: 0Deprecated: Use codeGeneration() instead
  • 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
  • hash {Hash}
  • context {UpdateHashContextDependency}
  • Returns: {void}

Updates the hash with the data contributed by this instance.


Attributes
compilation:<Compilation>
Returns:
{CssLoadingRuntimeModulePluginHooks}

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

Gets source basic types.