On this page

class webpack.AssetGenerator extends Generator

Represents the generator runtime component.

new AssetGenerator(): AssetGenerator
Attributes
dataUrlOptions:AssetGeneratorDataUrlOptions | ((source: string | Buffer<ArrayBufferLike>, context: { filename: string; module: Module }) => string)
emit:boolean
generate(module, generateContext): Source | null
Attributes
generateContext:GenerateContext
Returns:Source | null

Generates generated code for this runtime module.


generateDataUri(module): string
Attributes
Returns:string

Generates data uri.


generateError(error, module, generateContext): Source | null
Attributes
error:Error
generateContext:GenerateContext
Returns:Source | null

Generates fallback output for the provided error condition.


getConcatenationBailoutReason(module, context): string | undefined
Attributes

Returns the reason this module cannot be concatenated, when one exists.


getMimeType(module): string
Attributes
Returns:string

Returns mime type.


getSize(module, type?): number
Attributes
type:string
Returns:number

Returns the estimated size for the requested source type.


getTypes(module): ReadonlySet<string>
Attributes
Returns:ReadonlySet<string>

Returns the source types available for this module.


updateHash(hash, updateHashContextGenerator): void
Attributes
hash:Hash
updateHashContextGenerator:UpdateHashContextGenerator
Returns:void

Updates the hash with the data contributed by this instance.


Attributes
map:{ [index: string]: Generator | undefined }

Returns generator by type.