class webpack.Module extends DependenciesBlocknew Module(type, context?, layer?): ModuleCreates an instance of Module.
AsyncDependenciesBlock[]BuildInfoBuildMetaDependency[]string | nullnumberDependency[]number | nullanystringFactoryMetaanystringbooleannumber | nullnumber | nullModule | nullanystring | nullstringboolean(string | ((requestShortener: RequestShortener) => string))[]booleanDependenciesBlockDependency[]ModuleProfilestringResolveOptionsstringanyboolean | SortableSet<string> | nullbooleanbooleananyaddBlock(block): voidAsyncDependenciesBlockvoidAdds a DependencyBlock to DependencyBlock relationship. This is used for when a Module has a AsyncDependencyBlock tie (for code-splitting)
addCacheDependencies(fileDependencies, contextDependencies, missingDependencies, buildDependencies): voidvoidAdds the provided file dependencies to the module.
addChunk(chunk): booleanAdds the provided chunk to the module.
addCodeGenerationDependency(codeGenerationDependency): voidDependencyvoidAdds code generation dependency.
addDependency(dependency): voidDependencyvoidAdds the provided dependency to the dependencies block.
addError(error): voidAdds the provided error to the module.
addPresentationalDependency(presentationalDependency): voidDependencyvoidAdds presentational dependency.
addWarning(warning): voidAdds the provided warning to the module.
build(options, compilation, resolver, fs, callback): voidCompilationResolverWithOptions(err?: WebpackError) => voidvoidBuilds the module using the provided compilation context.
chunkCondition(chunk, compilation): booleanChunkCompilationbooleanReturns true if the module can be placed in the chunk.
cleanupForCache(): voidvoidAssuming this module is in the cache. Remove internal references to allow freeing some memory.
clearDependenciesAndBlocks(): voidvoidClear dependencies and blocks.
clearWarningsAndErrors(): voidvoidremoves all warnings and errors
codeGeneration(context): CodeGenerationResultCodeGenerationContextCodeGenerationResultGenerates code and runtime requirements for this module.
deserialize(objectDeserializerContext): voidObjectDeserializerContextvoidRestores this instance from the provided deserializer context.
getChunks(): Chunk[]Chunk[]getConcatenationBailoutReason(context): string | undefinedReturns the reason this module cannot be concatenated, when one exists.
getErrors(): Error[] | undefinedReturns list of errors if any.
getExportsType(moduleGraph, strict?): ExportsTypeModuleGraphbooleanExportsType...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: exportsReturns export type.
getNumberOfChunks(): numbernumbergetNumberOfErrors(): numbernumberGets number of errors.
getNumberOfWarnings(): numbernumberGets number of warnings.
getRootBlock(): DependenciesBlockDependenciesBlockgetSideEffectsConnectionState(moduleGraph): ConnectionStateModuleGraphConnectionStateGets side effects connection state.
getSourceBasicTypes(): ReadonlySet<string>ReadonlySet<string>Gets source basic types.
getSourceTypes(): ReadonlySet<string>ReadonlySet<string>Returns the source types this module can generate.
getUnsafeCacheData(): UnsafeCacheDataUnsafeCacheDataModule should be unsafe cached. Get data that's needed for that. This data will be passed to restoreFromUnsafeCache later.
getWarnings(): Error[] | undefinedReturns list of warnings if any.
hasChunkCondition(): booleanbooleanhasReasonForChunk(chunk, moduleGraph, chunkGraph): booleanChunkModuleGraphChunkGraphbooleanChecks whether this module contains the chunk.
hasReasons(moduleGraph, runtime): booleanModuleGraphRuntimeSpecbooleanChecks whether this module contains the module graph.
identifier(): stringstringReturns the unique identifier used to reference this module.
invalidateBuild(): voidvoidInvalidates the cached state associated with this value.
isAccessibleInChunk(chunkGraph, chunk, ignoreChunk?): booleanChunkGraphChunkChunkbooleanChecks whether this module is accessible in chunk.
isAccessibleInChunkGroup(chunkGraph, chunkGroup, ignoreChunk?): booleanChunkGraphChunkGroupChunkbooleanChecks whether this module is accessible in chunk group.
isEntryModule(): booleanbooleanisInChunk(chunk): booleanChecks whether this module is in the provided chunk.
isOptional(moduleGraph): booleanModuleGraphbooleanChecks whether this module is optional.
isProvided(exportName): boolean | nullChecks whether this module provides the specified export.
libIdent(options): string | nullLibIdentOptionsstring | nullGets the library identifier.
nameForCondition(): string | nullstring | nullReturns the path used when matching this module against rule conditions.
needBuild(context, callback): voidNeedBuildContext(err?: WebpackError | null, needBuild?: boolean) => voidvoidChecks whether the module needs to be rebuilt for the current build state.
needRebuild(fileTimestamps, contextTimestamps): booleanChecks whether it needs rebuild.
originalSource(): Source | nullSource | nullGets the original source.
readableIdentifier(requestShortener): stringRequestShortenerstringReturns a human-readable identifier for this module.
removeChunk(chunk): voidRemoves the provided chunk from the module.
removeDependency(dependency): voidDependencyvoidRemoves dependency.
serialize(objectSerializerContext): voidObjectSerializerContextvoidSerializes this instance into the provided serializer context.
size
size(type?): numberReturns the estimated size for the requested source type.
source(dependencyTemplates, runtimeTemplate, type?): SourceDependencyTemplatesRuntimeTemplatestringSourceReturns generated source.
updateCacheModule(module): voidAssuming 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): voidUpdates the hash with the data contributed by this instance.
Gets source basic types.