import { type Compilation, type Compiler } from 'webpack'; export interface HtmlMeta { [key: string]: string | undefined | HtmlMeta; } export interface HtmlPluginOption { /** * 公共路径, 默认使用 主配置的 publicPath */ publicPath?: string; /** * 网站图标 */ favicon?: string | false; /** * 页面标题 */ title?: string; /** * 模板文件 */ template?: string; /** * 输出文件名 * @default index.html */ filename?: string | ((entryName: string) => string); /** * 注入位置 * @default head */ inject?: boolean | 'head' | 'body'; templateContent?: (options: HtmlPluginOption) => string; /** * 自定义额外的 tags, 当需要添加远程cdn时很有用 * */ tags?: { /** * 标签内容 */ textContent?: string; /** 标签 * @default script */ tag?: string; inject?: 'body' | 'head'; [key: string]: string | null | boolean | number | undefined; }[]; meta?: HtmlMeta; } export declare class HtmlPlugin { private options; private AddEntry; private faviconPath; private name; private cachedMetaTags; private cachedCustomTags; constructor(options?: HtmlPluginOption); getPublicPath(compilation: Compilation): string; apply(compiler: Compiler): void; private generateDefaultTemplate; private generateMetaTags; private generateCustomTags; private getAssets; private injectAssets; }