class webpack.HtmlParser extends ParserDefines the parser state base type used by this module.
new HtmlParser(): HtmlParserReturns:
HtmlParserAttributes
magicCommentContext:
ContextsourcesByTag:
Record<string, Record<string, SourceItem>>template:
(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.
Attributes
Type:
"script" | "css-url" | "stylesheet" | "script-module" | "modulepreload" | "src" | "srcset" | "stylesheet-style" | "stylesheet-style-attribute" | "srcdoc" | "msapplication-task"Type:
"script" | "css-url" | "stylesheet" | "script-module" | "modulepreload" | "src" | "srcset" | "stylesheet-style" | "stylesheet-style-attribute" | "srcdoc" | "msapplication-task" | ((attrs: Map<string, string>, css: boolean) => SourceType)