- {DependenciesBlock}
- {ExternalModule}
- {NormalModule}
- {RuntimeModule}
new Module(type, context?, layer?): ModuleAttributes
Returns:
{Module}
blocks{AsyncDependenciesBlock[]}buildInfo{BuildInfo}buildMeta{BuildMeta}chunksIterable{Iterable} codeGenerationDependencies{Dependency[]}context<string>debugId<number>dependencies{Dependency[]}depth<number>errors<any>exportsArgument<string>factoryMeta{FactoryMeta}hasEqualsChunks<any>hash<string>hot<boolean>id<string>|<number>index<number>index2<number>issuer{Module}isUsed<any>layer<string>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} useSimpleSourceMap<boolean>useSourceMap<boolean>warnings<any>
webpack.Module.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.Module.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.Module.addChunk(chunk): voidchunk{Chunk} the chunk- Returns:
<boolean>true, when the module was added
webpack.Module.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.Module.addDependency(dependency): voiddependency{Dependency}- Returns: {void}
webpack.Module.addError(error): voiderror{WebpackError} the error- Returns: {void}
webpack.Module.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.Module.addWarning(warning): voidwarning{WebpackError} the warning- Returns: {void}
webpack.Module.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.Module.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.Module.cleanupForCache(): voidReturns:
{void}
Assuming this module is in the cache. Remove internal references to allow freeing some memory.
webpack.Module.clearDependenciesAndBlocks(): voidReturns:
{void}
Removes all dependencies and blocks
webpack.Module.clearWarningsAndErrors(): voidReturns:
{void}
removes all warnings and errors
webpack.Module.codeGeneration(context): voidcontext{CodeGenerationContext} context for code generation- Returns: {CodeGenerationResult} result
webpack.Module.deserialize(__namedParameters): void__namedParameters{ObjectDeserializerContext} context- Returns: {void}
webpack.Module.getChunks(): Chunk[]Returns:
{Chunk[]}
webpack.Module.getConcatenationBailoutReason(context): voidcontext{ConcatenationBailoutReasonContext} context- Returns:
<string>reason why this module can't be concatenated, undefined when it can be concatenated
webpack.Module.getErrors(): Iterable<WebpackError, any, any>Returns:
{Iterable<WebpackError, any, any>} list of errors if any
webpack.Module.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.Module.getNumberOfChunks(): numberReturns:
<number>webpack.Module.getNumberOfErrors(): numberReturns:
<number>number of errors
webpack.Module.getNumberOfWarnings(): numberReturns:
<number>number of warnings
webpack.Module.getRootBlock(): DependenciesBlockReturns:
{DependenciesBlock}
webpack.Module.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.Module.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
webpack.Module.getSourceTypes(): ReadonlySet<string>Returns:
{ReadonlySet
} types available (do not mutate)
webpack.Module.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.
webpack.Module.getWarnings(): Iterable<WebpackError, any, any>Returns:
{Iterable<WebpackError, any, any>} list of warnings if any
webpack.Module.hasChunkCondition(): booleanReturns:
<boolean>webpack.Module.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.Module.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.Module.identifier(): stringReturns:
<string>a unique identifier of the module
webpack.Module.invalidateBuild(): voidReturns:
{void}
webpack.Module.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.Module.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.Module.isEntryModule(): booleanReturns:
<boolean>webpack.Module.isInChunk(chunk): voidchunk{Chunk} the chunk- Returns:
<boolean>true, when the module is in the chunk
webpack.Module.isOptional(moduleGraph): voidmoduleGraph{ModuleGraph} the module graph- Returns:
<boolean>true, if the module is optional
webpack.Module.isProvided(exportName): booleanAttributes
exportName:
<string>a name of an export
Returns:
<boolean>true, if the export is provided why the module.
null, if it's unknown.
false, if it's not provided.
webpack.Module.libIdent(options): voidoptions{LibIdentOptions} options- Returns:
<string>an identifier for library inclusion
webpack.Module.nameForCondition(): stringReturns:
<string>absolute path which should be used for condition matching (usually the resource path)
webpack.Module.needBuild(context, callback): voidcontext{NeedBuildContext} context infocallback<object>callback function, returns true, if the module needs a rebuild- Returns: {void}
webpack.Module.needRebuild(fileTimestamps, contextTimestamps): voidStability: 0Deprecated: Use needBuild instead
fileTimestamps{Map<string, number>} timestamps of filescontextTimestamps{Map<string, number>} timestamps of directories- Returns:
<boolean>true, if the module needs a rebuild
webpack.Module.originalSource(): SourceReturns:
{Source} the original source for the module before webpack transformation
webpack.Module.readableIdentifier(requestShortener): voidrequestShortener{RequestShortener} the request shortener- Returns:
<string>a user readable identifier of the module
webpack.Module.removeChunk(chunk): voidchunk{Chunk} the chunk- Returns: {void}
webpack.Module.removeDependency(dependency): voiddependency{Dependency}- Returns: {void}
webpack.Module.serialize(__namedParameters): void__namedParameters{ObjectSerializerContext} context- Returns: {void}
webpack.Module.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)
webpack.Module.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
webpack.Module.updateCacheModule(module): voidmodule{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.
webpack.Module.updateHash(hash, context): voidhash{Hash} the hash used to track dependenciescontext{UpdateHashContextDependency} context- Returns: {void}
webpack.Module.getSourceBasicTypes(module): voidStability: 0Deprecated: In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method.
module{Module} the module- Returns: {ReadonlySet
} the source types of the module