- {Module}
new NormalModule(__namedParameters): void__namedParameters{NormalModuleCreateData} options object- Returns: {NormalModule}
<boolean><string><number><number><any><string><boolean><Generator><any><string><boolean><number><number><any><string><string><string><boolean><string>
|
<object[]><boolean><string><string><string><string><string><any><string><boolean><boolean><any>webpack.NormalModule.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.NormalModule.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.NormalModule.addChunk(chunk): voidchunk{Chunk} the chunk- Returns:
<boolean>true, when the module was added
webpack.NormalModule.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.NormalModule.addDependency(dependency): voiddependency{Dependency}- Returns: {void}
webpack.NormalModule.addError(error): voiderror{WebpackError} the error- Returns: {void}
webpack.NormalModule.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.NormalModule.addWarning(warning): voidwarning{WebpackError} the warning- Returns: {void}
webpack.NormalModule.applyNoParseRule(rule, content): boolean<boolean>webpack.NormalModule.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.NormalModule.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.NormalModule.cleanupForCache(): voidAssuming this module is in the cache. Remove internal references to allow freeing some memory.
webpack.NormalModule.clearDependenciesAndBlocks(): voidRemoves all dependencies and blocks
webpack.NormalModule.clearWarningsAndErrors(): voidremoves all warnings and errors
webpack.NormalModule.codeGeneration(context): voidcontext{CodeGenerationContext} context for code generation- Returns: {CodeGenerationResult} result
webpack.NormalModule.createSource(context, content, sourceMap?, associatedObjectForCache?): Sourcewebpack.NormalModule.createSourceForAsset(context, name, content, sourceMap?, associatedObjectForCache?): Sourcewebpack.NormalModule.deserialize(__namedParameters): void__namedParameters{ObjectDeserializerContext} context- Returns: {void}
webpack.NormalModule.getChunks(): Chunk[]webpack.NormalModule.getConcatenationBailoutReason(context): voidcontext{ConcatenationBailoutReasonContext} context- Returns:
<string>reason why this module can't be concatenated, undefined when it can be concatenated
webpack.NormalModule.getCurrentLoader(loaderContext, index?): voidloaderContext{AnyLoaderContext} loader contextindex<number>index- Returns: {LoaderItem} loader
webpack.NormalModule.getErrors(): Iterable<WebpackError, any, any>webpack.NormalModule.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.NormalModule.getNumberOfChunks(): number<number>webpack.NormalModule.getNumberOfErrors(): number<number>webpack.NormalModule.getNumberOfWarnings(): number<number>webpack.NormalModule.getResource(): string<string>webpack.NormalModule.getRootBlock(): DependenciesBlockwebpack.NormalModule.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.NormalModule.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.NormalModule.getSourceTypes(): ReadonlySet<string>webpack.NormalModule.getUnsafeCacheData(): UnsafeCacheDataModule should be unsafe cached. Get data that's needed for that. This data will be passed to restoreFromUnsafeCache later.
webpack.NormalModule.getWarnings(): Iterable<WebpackError, any, any>webpack.NormalModule.hasChunkCondition(): boolean<boolean>webpack.NormalModule.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.NormalModule.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.NormalModule.identifier(): string<string>webpack.NormalModule.invalidateBuild(): voidwebpack.NormalModule.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.NormalModule.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.NormalModule.isEntryModule(): boolean<boolean>webpack.NormalModule.isInChunk(chunk): voidchunk{Chunk} the chunk- Returns:
<boolean>true, when the module is in the chunk
webpack.NormalModule.isOptional(moduleGraph): voidmoduleGraph{ModuleGraph} the module graph- Returns:
<boolean>true, if the module is optional
webpack.NormalModule.isProvided(exportName): boolean<string><boolean>webpack.NormalModule.libIdent(options): voidoptions{LibIdentOptions} options- Returns:
<string>an identifier for library inclusion
webpack.NormalModule.markModuleAsErrored(error): voiderror{WebpackError} the error- Returns: {void}
webpack.NormalModule.nameForCondition(): string<string>webpack.NormalModule.needBuild(context, callback): voidcontext{NeedBuildContext} context infocallback<object>callback function, returns true, if the module needs a rebuild- Returns: {void}
webpack.NormalModule.needRebuild(fileTimestamps, contextTimestamps): voidfileTimestamps{Map<string, number>}contextTimestamps{Map<string, number>}- Returns:
<boolean>
Use needBuild instead
webpack.NormalModule.originalSource(): Sourcewebpack.NormalModule.readableIdentifier(requestShortener): voidrequestShortener{RequestShortener} the request shortener- Returns:
<string>a user readable identifier of the module
webpack.NormalModule.removeChunk(chunk): voidchunk{Chunk} the chunk- Returns: {void}
webpack.NormalModule.removeDependency(dependency): voiddependency{Dependency}- Returns: {void}
webpack.NormalModule.restoreFromUnsafeCache(unsafeCacheData, normalModuleFactory): voidunsafeCacheData{UnsafeCacheData} data from getUnsafeCacheDatanormalModuleFactory{NormalModuleFactory} the normal module factory handling the unsafe caching- Returns: {void}
restore unsafe cache data
webpack.NormalModule.serialize(__namedParameters): void__namedParameters{ObjectSerializerContext} context- Returns: {void}
webpack.NormalModule.shouldPreventParsing(noParseRule, request): boolean<boolean>webpack.NormalModule.size(type?): number<string><number>webpack.NormalModule.source(dependencyTemplates, runtimeTemplate, type?): voiddependencyTemplates{DependencyTemplates}runtimeTemplate{RuntimeTemplate}type<string>- Returns: {Source}
Use codeGeneration() instead
webpack.NormalModule.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.NormalModule.updateHash(hash, context): voidhash{Hash} the hash used to track dependenciescontext{UpdateHashContextDependency} context- Returns: {void}
webpack.NormalModule.deserialize(context): voidcontext{ObjectDeserializerContext} context- Returns: {NormalModule}
webpack.NormalModule.getCompilationHooks(compilation): voidcompilation{Compilation} the compilation- Returns: {NormalModuleCompilationHooks} the attached hooks
webpack.NormalModule.getSourceBasicTypes(module): voidmodule{Module}- Returns: {ReadonlySet
}
In webpack 6, call getSourceBasicTypes() directly on the module instance instead of using this static method.