- {Module}
- {GetChunkFilenameRuntimeModule}
- {JsonpChunkLoadingRuntimeModule}
- {CssLoadingRuntimeModule}
- {ModuleChunkLoadingRuntimeModule}
new RuntimeModule(name, stage?): RuntimeModuleblocks{AsyncDependenciesBlock[]}buildInfo{BuildInfo}buildMeta{BuildMeta}chunk{Chunk}chunkGraph{ChunkGraph}chunksIterable{Iterable} codeGenerationDependencies{Dependency[]}compilation{Compilation}context<string>debugId<number>dependencies{Dependency[]}dependentHash<boolean>depth<number>errors<any>exportsArgument<string>factoryMeta{FactoryMeta}fullHash<boolean>hasEqualsChunks<any>hash<string>hot<boolean>id<string>|<number>index<number>index2<number>issuer{Module}isUsed<any>layer<string>moduleArgument<string>name<string>needId<boolean>optimizationBailout<string>|<object[]>optional<boolean>parent{DependenciesBlock}presentationalDependencies{Dependency[]}profile{ModuleProfile}renderedHash<string>resolveOptions{ResolveOptions}stage<number>type<string>used<any>usedExports{boolean|SortableSet} useSimpleSourceMap<boolean>useSourceMap<boolean>warnings<any>STAGE_ATTACH<number>Runtime modules which attach to handlers of other runtime modulesSTAGE_BASIC<number>Runtime modules with simple dependencies on other runtime modulesSTAGE_NORMAL<number>Runtime modules without any dependencies to other runtime modulesSTAGE_TRIGGER<number>Runtime modules which trigger actions on bootstrap
webpack.RuntimeModule.addBlock(block): voidblock{AsyncDependenciesBlock}- Returns: {void}
Adds a DependencyBlock to DependencyBlock relationship. This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
webpack.RuntimeModule.addCacheDependencies(fileDependencies, contextDependencies, missingDependencies, buildDependencies): voidfileDependencies{LazySet} set where file dependencies are added to contextDependencies{LazySet} set where context dependencies are added to missingDependencies{LazySet} set where missing dependencies are added to buildDependencies{LazySet} set where build dependencies are added to - Returns: {void}
webpack.RuntimeModule.addChunk(chunk): voidchunk{Chunk} the chunk- Returns:
<boolean>true, when the module was added
webpack.RuntimeModule.addCodeGenerationDependency(codeGenerationDependency): voidcodeGenerationDependency{Dependency} dependency being tied to module. This is a Dependency where the code generation result of the referenced module is needed during code generation. The Dependency should also be added to normal dependencies via addDependency.- Returns: {void}
webpack.RuntimeModule.addDependency(dependency): voiddependency{Dependency}- Returns: {void}
webpack.RuntimeModule.addError(error): voiderror{WebpackError} the error- Returns: {void}
webpack.RuntimeModule.addPresentationalDependency(presentationalDependency): voidpresentationalDependency{Dependency} dependency being tied to module. This is a Dependency without edge in the module graph. It's only for presentation.- Returns: {void}
webpack.RuntimeModule.addWarning(warning): voidwarning{WebpackError} the warning- Returns: {void}
webpack.RuntimeModule.attach(compilation, chunk, chunkGraph?): voidcompilation{Compilation} the compilationchunk{Chunk} the chunkchunkGraph{ChunkGraph} the chunk graph- Returns: {void}
webpack.RuntimeModule.build(options, compilation, resolver, fs, callback): voidoptions{WebpackOptionsNormalizedWithDefaults} webpack optionscompilation{Compilation} the compilationresolver{ResolverWithOptions} the resolverfs{InputFileSystem} the file systemcallback<object>callback function- Returns: {void}
webpack.RuntimeModule.chunkCondition(chunk, compilation): voidchunk{Chunk} the chunk which condition should be checkedcompilation{Compilation} the compilation- Returns:
<boolean>true if the module can be placed in the chunk
webpack.RuntimeModule.cleanupForCache(): voidAssuming this module is in the cache. Remove internal references to allow freeing some memory.
webpack.RuntimeModule.clearDependenciesAndBlocks(): voidRemoves all dependencies and blocks
webpack.RuntimeModule.clearWarningsAndErrors(): voidremoves all warnings and errors
webpack.RuntimeModule.codeGeneration(context): voidcontext{CodeGenerationContext} context for code generation- Returns: {CodeGenerationResult} result
webpack.RuntimeModule.deserialize(__namedParameters): void__namedParameters{ObjectDeserializerContext} context- Returns: {void}
webpack.RuntimeModule.generate(): string<string>webpack.RuntimeModule.getChunks(): Chunk[]webpack.RuntimeModule.getConcatenationBailoutReason(context): voidcontext{ConcatenationBailoutReasonContext} context- Returns:
<string>reason why this module can't be concatenated, undefined when it can be concatenated
webpack.RuntimeModule.getErrors(): Iterable<WebpackError, any, any>webpack.RuntimeModule.getExportsType(moduleGraph, strict?): voidmoduleGraph{ModuleGraph} the module graphstrict<boolean>the importing module is strict- Returns: {ExportsType} export type "namespace": Exports is already a namespace object. namespace = exports. "dynamic": Check at runtime if __esModule is set. When set: namespace = { ...exports, default: exports }. When not set: namespace = { default: exports }. "default-only": Provide a namespace object with only default export. namespace = { default: exports } "default-with-named": Provide a namespace object with named and default export. namespace = { ...exports, default: exports }
webpack.RuntimeModule.getGeneratedCode(): string<string>webpack.RuntimeModule.getNumberOfChunks(): number<number>webpack.RuntimeModule.getNumberOfErrors(): number<number>webpack.RuntimeModule.getNumberOfWarnings(): number<number>webpack.RuntimeModule.getRootBlock(): DependenciesBlockwebpack.RuntimeModule.getSideEffectsConnectionState(moduleGraph): voidmoduleGraph{ModuleGraph} the module graph- Returns: {ConnectionState} how this module should be connected to referencing modules when consumed for side-effects only
webpack.RuntimeModule.getSourceBasicTypes(): 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.
webpack.RuntimeModule.getSourceTypes(): ReadonlySet<string>webpack.RuntimeModule.getUnsafeCacheData(): UnsafeCacheDataModule should be unsafe cached. Get data that's needed for that. This data will be passed to restoreFromUnsafeCache later.
webpack.RuntimeModule.getWarnings(): Iterable<WebpackError, any, any>webpack.RuntimeModule.hasChunkCondition(): boolean<boolean>webpack.RuntimeModule.hasReasonForChunk(chunk, moduleGraph, chunkGraph): voidchunk{Chunk} a chunkmoduleGraph{ModuleGraph} the module graphchunkGraph{ChunkGraph} the chunk graph- Returns:
<boolean>true, if the module has any reason why "chunk" should be included
webpack.RuntimeModule.hasReasons(moduleGraph, runtime): voidmoduleGraph{ModuleGraph} the module graphruntime{RuntimeSpec} the runtime- Returns:
<boolean>true if at least one other module depends on this module
webpack.RuntimeModule.identifier(): string<string>webpack.RuntimeModule.invalidateBuild(): voidwebpack.RuntimeModule.isAccessibleInChunk(chunkGraph, chunk, ignoreChunk?): voidchunkGraph{ChunkGraph} the chunk graphchunk{Chunk} a chunkignoreChunk{Chunk} chunk to be ignored- Returns:
<boolean>true, if the module is accessible from "chunk" when ignoring "ignoreChunk"
webpack.RuntimeModule.isAccessibleInChunkGroup(chunkGraph, chunkGroup, ignoreChunk?): voidchunkGraph{ChunkGraph} the chunk graphchunkGroup{ChunkGroup} a chunk groupignoreChunk{Chunk} chunk to be ignored- Returns:
<boolean>true, if the module is accessible from "chunkGroup" when ignoring "ignoreChunk"
webpack.RuntimeModule.isEntryModule(): boolean<boolean>webpack.RuntimeModule.isInChunk(chunk): voidchunk{Chunk} the chunk- Returns:
<boolean>true, when the module is in the chunk
webpack.RuntimeModule.isOptional(moduleGraph): voidmoduleGraph{ModuleGraph} the module graph- Returns:
<boolean>true, if the module is optional
webpack.RuntimeModule.isProvided(exportName): boolean<string><boolean>webpack.RuntimeModule.libIdent(options): voidoptions{LibIdentOptions} options- Returns:
<string>an identifier for library inclusion
webpack.RuntimeModule.nameForCondition(): string<string>webpack.RuntimeModule.needBuild(context, callback): voidcontext{NeedBuildContext} context infocallback<object>callback function, returns true, if the module needs a rebuild- Returns: {void}
webpack.RuntimeModule.needRebuild(fileTimestamps, contextTimestamps): voidfileTimestamps{Map<string, number>}contextTimestamps{Map<string, number>}- Returns:
<boolean>
Use needBuild instead
webpack.RuntimeModule.originalSource(): Sourcewebpack.RuntimeModule.readableIdentifier(requestShortener): voidrequestShortener{RequestShortener} the request shortener- Returns:
<string>a user readable identifier of the module
webpack.RuntimeModule.removeChunk(chunk): voidchunk{Chunk} the chunk- Returns: {void}
webpack.RuntimeModule.removeDependency(dependency): voiddependency{Dependency}- Returns: {void}
webpack.RuntimeModule.serialize(__namedParameters): void__namedParameters{ObjectSerializerContext} context- Returns: {void}
webpack.RuntimeModule.shouldIsolate(): boolean<boolean>webpack.RuntimeModule.size(type?): number<string><number>webpack.RuntimeModule.source(dependencyTemplates, runtimeTemplate, type?): voiddependencyTemplates{DependencyTemplates}runtimeTemplate{RuntimeTemplate}type<string>- Returns: {Source}
Use codeGeneration() instead
webpack.RuntimeModule.updateCacheModule(module): voidmodule{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.
webpack.RuntimeModule.updateHash(hash, context): voidhash{Hash} the hash used to track dependenciescontext{UpdateHashContextDependency} context- Returns: {void}
webpack.RuntimeModule.getSourceBasicTypes(module): voidmodule{Module}- Returns: {ReadonlySet
} types available (do not mutate)
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.