new ExternalModule(request, type, userRequest, dependencyMeta?): voidrequest{ExternalModuleRequest} requesttype{ExternalsType} typeuserRequest<string>user requestdependencyMeta{ImportDependencyMeta|CssImportDependencyMeta|AssetDependencyMeta} dependency meta- Returns:
<ExternalModule>
<AsyncDependenciesBlock[]><Dependency[]><number><Dependency[]><any><string><any><string><boolean><any><string><boolean><string>
|
<object[]><boolean><Dependency[]><string><ResolveOptions><string><any><string><boolean><boolean><any><object>addBlock(block): void<AsyncDependenciesBlock>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): boolean<Chunk><boolean>addCodeGenerationDependency(codeGenerationDependency): void<Dependency>addDependency(dependency): void<Dependency>addError(error): void<WebpackError>addPresentationalDependency(presentationalDependency): void<Dependency>addWarning(warning): void<WebpackError>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): boolean<Chunk><Compilation><boolean>cleanupForCache(): voidAssuming this module is in the cache. Remove internal references to allow freeing some memory.
clearDependenciesAndBlocks(): voidRemoves all dependencies and blocks
clearWarningsAndErrors(): voidremoves all warnings and errors
codeGeneration(context): voidcontext{CodeGenerationContext} context for code generation- Returns: {CodeGenerationResult} result
deserialize(__namedParameters): void<ObjectDeserializerContext>getChunks(): Chunk[]<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> | undefinedgetExportsType(moduleGraph, strict?): ExportsType<ModuleGraph><boolean>getNumberOfChunks(): number<number>getNumberOfErrors(): number<number>getNumberOfWarnings(): number<number>getRootBlock(): DependenciesBlockgetSideEffectsConnectionState(moduleGraph): ConnectionState<ModuleGraph>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.
getSourceTypes(): ReadonlySet<string>getUnsafeCacheData(): UnsafeCacheDataModule should be unsafe cached. Get data that's needed for that. This data will be passed to restoreFromUnsafeCache later.
getWarnings(): Iterable<WebpackError, any, any> | undefinedhasChunkCondition(): boolean<boolean>hasReasonForChunk(chunk, moduleGraph, chunkGraph): boolean<boolean>hasReasons(moduleGraph, runtime): boolean<ModuleGraph><boolean>identifier(): string<string>invalidateBuild(): voidisAccessibleInChunk(chunkGraph, chunk, ignoreChunk?): boolean<boolean>isAccessibleInChunkGroup(chunkGraph, chunkGroup, ignoreChunk?): boolean<ChunkGraph><ChunkGroup><Chunk><boolean>isEntryModule(): boolean<boolean>isInChunk(chunk): boolean<Chunk><boolean>isOptional(moduleGraph): boolean<ModuleGraph><boolean>isProvided(exportName): boolean | null<string>libIdent(options): voidnameForCondition(): string | nullneedBuild(context, callback): voidcontext{NeedBuildContext} context infocallback<object>callback function, returns true, if the module needs a rebuild- Returns: {void}
needRebuild(fileTimestamps, contextTimestamps): voidfileTimestamps{Map<string, number|null>}contextTimestamps{Map<string, number|null>}- Returns:
<boolean>
Use needBuild instead
originalSource(): Source | nullreadableIdentifier(requestShortener): voidrequestShortener{RequestShortener} the request shortener- Returns:
<string>a user readable identifier of the module
removeChunk(chunk): void<Chunk>removeDependency(dependency): void<Dependency>restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory): voidunsafeCacheData{UnsafeCacheData} data from getUnsafeCacheDatanormalModuleFactory{NormalModuleFactory} the normal module factory handling the unsafe caching- Returns: {void}
restore unsafe cache data
serialize(__namedParameters): void<ObjectSerializerContext>size
size(type?): number<string><number>source(dependencyTemplates, runtimeTemplate, type?): voiddependencyTemplates{DependencyTemplates}runtimeTemplate{RuntimeTemplate}type<string>- Returns:
<Source>
Use codeGeneration() instead
updateCacheModule(module): void<Module>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}
<Compilation><Module>In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method.