import type { ConfigChainMergeContext, ConfigChainWithContext } from '../../reduceConfigs'; import type { OneOrMany } from '../utils'; export type CrossOrigin = 'anonymous' | 'use-credentials'; export type ScriptInject = boolean | 'body' | 'head'; export type ScriptLoading = 'defer' | 'module' | 'blocking'; export type OutputStructure = 'flat' | 'nested'; /** * custom properties * e.g. { name: 'viewport' content: 'width=500, initial-scale=1' } * */ export type MetaAttrs = { [attrName: string]: string | boolean; }; export type MetaOptions = { /** * name content pair * e.g. { viewport: 'width=device-width, initial-scale=1, shrink-to-fit=no' }` * */ [name: string]: string | false | MetaAttrs; }; export type HtmlBasicTag = { tag: string; attrs?: Record; children?: string; }; export type HtmlTag = HtmlBasicTag & { hash?: boolean | string | ((url: string, hash: string) => string); publicPath?: boolean | string | ((url: string, publicPath: string) => string); append?: boolean; head?: boolean; }; export type HtmlTagUtils = { hash: string; entryName: string; outputName: string; publicPath: string; }; export type HtmlTagHandler = (tags: HtmlTag[], utils: HtmlTagUtils) => HtmlTag[] | void; export type HtmlTagDescriptor = HtmlTag | HtmlTagHandler; type ChainedHtmlOption = ConfigChainMergeContext; export interface HtmlConfig { /** * Configure the `` tag of the HTML. */ meta?: ChainedHtmlOption; /** * Set the title tag of the HTML page. */ title?: ChainedHtmlOption; /** * Set the inject position of the `