import type { Compiler, Compilation } from 'webpack'; import type HtmlWebpackPlugin from 'html-webpack-plugin'; import type { HtmlTagObject } from 'html-webpack-plugin'; export type InlineChunkTestFunction = (params: { size: number; name: string; }) => boolean; export type InlineChunkTest = RegExp | InlineChunkTestFunction; export type InlineChunkHtmlPluginOptions = { styleTests: InlineChunkTest[]; scriptTests: InlineChunkTest[]; distPath: { js?: string; css?: string; }; }; export declare class InlineChunkHtmlPlugin { name: string; styleTests: InlineChunkTest[]; scriptTests: InlineChunkTest[]; distPath: InlineChunkHtmlPluginOptions['distPath']; inlinedAssets: Set; htmlPlugin: typeof HtmlWebpackPlugin; constructor(htmlPlugin: typeof HtmlWebpackPlugin, { styleTests, scriptTests, distPath }: InlineChunkHtmlPluginOptions); /** * If we inlined the chunk to HTML,we should update the value of sourceMappingURL, * because the relative path of source code has been changed. * @param source */ updateSourceMappingURL({ source, compilation, publicPath, type, }: { source: string; compilation: Compilation; publicPath: string; type: 'js' | 'css'; }): string; matchTests(name: string, source: string, tests: InlineChunkTest[]): boolean; getInlinedScriptTag(publicPath: string, tag: HtmlTagObject, compilation: Compilation): HtmlWebpackPlugin.HtmlTagObject | { tagName: string; innerHTML: string; attributes: { [x: string]: string | boolean | null | undefined; }; closeTag: boolean; }; getInlinedCSSTag(publicPath: string, tag: HtmlTagObject, compilation: Compilation): HtmlWebpackPlugin.HtmlTagObject | { tagName: string; innerHTML: string; closeTag: boolean; }; getInlinedTag(publicPath: string, tag: HtmlTagObject, compilation: Compilation): HtmlWebpackPlugin.HtmlTagObject; apply(compiler: Compiler): void; }