class webpack.HtmlParser extends ParserDefines the parser state base type used by this module.
new HtmlParser(): HtmlParserReturns:
HtmlParserAttributes
fragmentContext:
stringmagicCommentContext:
ContextsourcesByTag:
SourceTabletemplate:
(source: string, context: HtmlTemplateContext) => stringapplyTemplate(source, module): string | Buffer<ArrayBufferLike>Attributes
Runs the template option over the source and returns the transformed
html. Called from HtmlModulesPlugin's processResult, where the return
value becomes the module's stored source so the parser (which records
dependency offsets against it) and the generator (which renders from
module.originalSource()) stay in agreement.
parse(source, state): ParserStateAttributes
Parses the provided source and updates the parser state.
[index: {string}]SourceItem | undefined
Attributes
[index: {string}]SourceBucket
Type:
"html" | "script" | "css-url" | "stylesheet" | "prefetch" | "preload" | "modulepreload" | "script-module" | "src" | "srcset" | "stylesheet-style" | "stylesheet-style-attribute" | "srcdoc" | "msapplication-task"Type:
"html" | "script" | "css-url" | "stylesheet" | "prefetch" | "preload" | "modulepreload" | "script-module" | "src" | "srcset" | "stylesheet-style" | "stylesheet-style-attribute" | "srcdoc" | "msapplication-task" | ((attrs: Map<string, string>, css: boolean) => SourceType)