- {DependenciesBlock}
Attributes
new Module(type, context?, layer?): ModuleAttributes
Returns:
<Module>Attributes
blocks:
<AsyncDependenciesBlock[]>buildInfo:
{BuildInfo}
buildMeta:
{BuildMeta}
chunksIterable:
{Iterable
}
codeGenerationDependencies:
<Dependency[]>debugId:
<number>dependencies:
<Dependency[]>errors:
<any>exportsArgument:
<string>factoryMeta:
{FactoryMeta}
hasEqualsChunks:
<any>hash:
<string>hot:
<boolean>isUsed:
<any>moduleArgument:
<string>needId:
<boolean>optimizationBailout:
<string>
|
<object[]>optional:
<boolean>parent:
{DependenciesBlock}
presentationalDependencies:
<Dependency[]>profile:
{ModuleProfile}
renderedHash:
<string>resolveOptions:
<ResolveOptions>type:
<string>used:
<any>usedExports:
{boolean|SortableSet
|null}
useSimpleSourceMap:
<boolean>useSourceMap:
<boolean>warnings:
<any>addBlock(block): voidAttributes
block:
<AsyncDependenciesBlock>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): 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}
addChunk(chunk): booleanAttributes
chunk:
<Chunk>the chunk
Returns:
<boolean>true, when the module was added
addCodeGenerationDependency(codeGenerationDependency): voidAttributes
codeGenerationDependency:
<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}
addDependency(dependency): voidAttributes
dependency:
<Dependency>Returns:
{void}
addError(error): voidAttributes
error:
<WebpackError>the error
Returns:
{void}
addPresentationalDependency(presentationalDependency): voidAttributes
presentationalDependency:
<Dependency>dependency being tied to module.
This is a Dependency without edge in the module graph. It's only for presentation.
Returns:
{void}
addWarning(warning): voidAttributes
warning:
<WebpackError>the warning
Returns:
{void}
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}
chunkCondition(chunk, compilation): booleanAttributes
chunk:
<Chunk>the chunk which condition should be checked
compilation:
<Compilation>the compilation
Returns:
<boolean>true if the module can be placed in the chunk
cleanupForCache(): voidReturns:
{void}
Assuming this module is in the cache. Remove internal references to allow freeing some memory.
clearDependenciesAndBlocks(): voidReturns:
{void}
Removes all dependencies and blocks
clearWarningsAndErrors(): voidReturns:
{void}
removes all warnings and errors
codeGeneration(context): voidcontext{CodeGenerationContext} context for code generation- Returns: {CodeGenerationResult} result
deserialize(__namedParameters): voidAttributes
__namedParameters:
<ObjectDeserializerContext>context
Returns:
{void}
getChunks(): Chunk[]Returns:
<Chunk[]>getConcatenationBailoutReason(context): voidcontext{ConcatenationBailoutReasonContext} context- Returns:
<string>|<undefined>reason why this module can't be concatenated, undefined when it can be concatenated
getErrors(): Iterable<WebpackError, any, any> | undefinedReturns:
{Iterable<WebpackError, any, any>|undefined} list of errors if any
getExportsType(moduleGraph, strict?): ExportsTypeAttributes
moduleGraph:
<ModuleGraph>the module graph
strict:
<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 }
getNumberOfChunks(): numberReturns:
<number>getNumberOfErrors(): numberReturns:
<number>number of errors
getNumberOfWarnings(): numberReturns:
<number>number of warnings
getRootBlock(): DependenciesBlockReturns:
{DependenciesBlock}
getSideEffectsConnectionState(moduleGraph): ConnectionStateAttributes
moduleGraph:
<ModuleGraph>the module graph
Returns:
{ConnectionState} how this module should be connected to referencing modules when consumed for side-effects only
getSourceBasicTypes(): ReadonlySet<string>Stability: 0Deprecated: In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method.
Returns:
{ReadonlySet
} the source types of the module
getSourceTypes(): ReadonlySet<string>Returns:
{ReadonlySet
} types available (do not mutate)
getUnsafeCacheData(): UnsafeCacheDataReturns:
{UnsafeCacheData} cached data
Module should be unsafe cached. Get data that's needed for that. This data will be passed to restoreFromUnsafeCache later.
getWarnings(): Iterable<WebpackError, any, any> | undefinedReturns:
{Iterable<WebpackError, any, any>|undefined} list of warnings if any
hasChunkCondition(): booleanReturns:
<boolean>hasReasonForChunk(chunk, moduleGraph, chunkGraph): booleanAttributes
Returns:
<boolean>true, if the module has any reason why "chunk" should be included
hasReasons(moduleGraph, runtime): booleanAttributes
moduleGraph:
<ModuleGraph>the module graph
runtime:
{RuntimeSpec} the runtime
Returns:
<boolean>true if at least one other module depends on this module
identifier(): stringReturns:
<string>a unique identifier of the module
invalidateBuild(): voidReturns:
{void}
isAccessibleInChunk(chunkGraph, chunk, ignoreChunk?): booleanAttributes
Returns:
<boolean>true, if the module is accessible from "chunk" when ignoring "ignoreChunk"
isAccessibleInChunkGroup(chunkGraph, chunkGroup, ignoreChunk?): booleanAttributes
chunkGraph:
<ChunkGraph>the chunk graph
chunkGroup:
<ChunkGroup>a chunk group
ignoreChunk:
<Chunk>chunk to be ignored
Returns:
<boolean>true, if the module is accessible from "chunkGroup" when ignoring "ignoreChunk"
isEntryModule(): booleanReturns:
<boolean>isInChunk(chunk): booleanAttributes
chunk:
<Chunk>the chunk
Returns:
<boolean>true, when the module is in the chunk
isOptional(moduleGraph): booleanAttributes
moduleGraph:
<ModuleGraph>the module graph
Returns:
<boolean>true, if the module is optional
isProvided(exportName): boolean | nullAttributes
exportName:
<string>a name of an export
true, if the export is provided why the module.
null, if it's unknown.
false, if it's not provided.
libIdent(options): voidnameForCondition(): string | nullabsolute path which should be used for condition matching (usually the resource path)
needBuild(context, callback): voidcontext{NeedBuildContext} context infocallback<object>callback function, returns true, if the module needs a rebuild- Returns: {void}
needRebuild(fileTimestamps, contextTimestamps): voidStability: 0Deprecated: Use needBuild instead
fileTimestamps{Map<string, number|null>} timestamps of filescontextTimestamps{Map<string, number|null>} timestamps of directories- Returns:
<boolean>true, if the module needs a rebuild
originalSource(): Source | nullreadableIdentifier(requestShortener): voidrequestShortener{RequestShortener} the request shortener- Returns:
<string>a user readable identifier of the module
removeChunk(chunk): voidAttributes
chunk:
<Chunk>the chunk
Returns:
{void}
removeDependency(dependency): voidAttributes
dependency:
<Dependency>Returns:
{void}
serialize(__namedParameters): voidAttributes
__namedParameters:
<ObjectSerializerContext>context
Returns:
{void}
M
size
size(type?): numberAttributes
type:
<string>the source type for which the size should be estimated
Returns:
<number>the estimated size of the module (must be non-zero)
source(dependencyTemplates, runtimeTemplate, type?): voidStability: 0Deprecated: Use codeGeneration() instead
dependencyTemplates{DependencyTemplates} the dependency templatesruntimeTemplate{RuntimeTemplate} the runtime templatetype<string>the type of source that should be generated- Returns:
<Source>generated source
updateCacheModule(module): voidAttributes
module:
<Module>fresh 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): voidhash{Hash} the hash used to track dependenciescontext{UpdateHashContextDependency} context- Returns: {void}
Stability: 0Deprecated: In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method.
Attributes
module:
<Module>the module
Returns:
{ReadonlySet
} the source types of the module