On this page

new HtmlModulesPlugin(): HtmlModulesPlugin
Attributes
getCompilationHooks:(compilation: Compilation) => { htmlEmitted: AsyncSeriesHook<[HtmlEmittedContext]>; injectTags: AsyncSeriesWaterfallHook<[HtmlTagDescriptor[], HtmlInjectTagsContext], HtmlTagDescriptor[]>; transformHtml: AsyncSeriesWaterfallHook<[string, HtmlTransformHtmlContext], string>; transformTags: AsyncSeriesHook<[HtmlMutableTag[], HtmlTransformTagsContext]> }
Per-compilation hooks for the experimental HTML support.
apply(compiler): void
Attributes
compiler:Compiler
the compiler instance
Returns:void

Applies the plugin by registering its hooks on the compiler.


Attributes
content:string | Buffer<ArrayBufferLike>
content to hash
outputOptions:Output
output options
Returns:string
content hash

output.hashFunction/hashSalt/hashDigest/hashDigestLength digest of content, with nonNumericOnlyHash applied — webpack's standard [contenthash] recipe.


Attributes
chunk:Chunk
chunk
outputOptions:Output
output options
used filename template

Filename template for an extracted HTML page: output.htmlFilename for initial chunks, output.htmlChunkFilename otherwise — the HTML counterpart of CssModulesPlugin.getChunkFilenameTemplate.

Attributes
outputName:string

Attributes
html:string
outputName:string

Attributes
attrs:Record<string, undefined | string | boolean>
mutable attributes; a string value renders name="value" , true a bare attribute, false / undefined /deleting the key drops it
injectTo:"body" | "head" | "head-prepend" | "body-prepend"
the tag's current region ( "head" / "body" ); set a different value to move it there ( *-prepend to the region's start)
remove:boolean
set true to delete the whole element
tag:string
the (lowercased) tag name

Attributes
attrs:Record<string, string | boolean | undefined>
attributes; true renders a bare boolean attribute, false / undefined is omitted
children:string
inner content (ignored for void elements like <link> / <meta> )
injectTo:"body" | "head" | "head-prepend" | "body-prepend"
placement; defaults to "head"
tag:string
tag name, e.g. "script" / "link" / "meta"
voidTag:boolean
force a void element (no closing tag); inferred from the tag name when omitted

Attributes
outputName:string

Attributes
html:string
outputName:string