On this page

Source Code: lib/html/HtmlModulesPlugin.js#L253
new HtmlModulesPlugin(): HtmlModulesPlugin
HtmlModulesPlugin.getCompilationHooks(compilation): { htmlEmitted: AsyncSeriesHook<[HtmlEmittedContext]>; injectTags: AsyncSeriesWaterfallHook<[HtmlTagDescriptor[], HtmlInjectTagsContext], HtmlTagDescriptor[]>; transformHtml: AsyncSeriesWaterfallHook<[string, HtmlTransformHtmlContext], string>; transformTags: AsyncSeriesHook<[HtmlMutableTag[], HtmlTransformTagsContext]> }
Attributes
compilation:Compilation
Returns:{ 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.

htmlModulesPlugin.apply(compiler): void
Source Code: lib/html/HtmlModulesPlugin.js#L299
Attributes
compiler:Compiler

Applies the plugin by registering its hooks on the compiler.

HtmlModulesPlugin.computeContentHash(content, outputOptions): string
Source Code: lib/html/HtmlModulesPlugin.js#L262
Attributes
content:string | Buffer<ArrayBufferLike>
outputOptions:Output
Returns:string

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

HtmlModulesPlugin.getChunkFilenameTemplate(chunk, outputOptions): ChunkFilenameTemplate
Source Code: lib/html/HtmlModulesPlugin.js#L284
Attributes
chunk:Chunk
outputOptions:Output

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