UNPKG

1.53 kBTypeScriptView Raw
1import webpack, { WebpackPluginInstance } from 'webpack';
2declare type Attributes = Record<string, any>;
3declare type Context = {
4 title?: string;
5 htmlAttributes?: Attributes;
6 cssAttributes?: Attributes;
7 jsAttributes?: Attributes;
8};
9declare type TemplateParameters = {
10 css?: string[];
11 js?: string[];
12 body?: string;
13 head?: string;
14 publicPath: string;
15} & Context;
16declare type Options = {
17 filename?: string;
18 publicPath?: string;
19 context?: Context;
20 template?: (args: TemplateParameters) => string | Promise<string>;
21 chunks?: string[];
22};
23declare function generateAttributes(attributes?: {}): string;
24declare function generateCSSReferences({ files, publicPath, attributes, }: {
25 files: string[];
26 publicPath: string;
27 attributes: (Attributes & {
28 rel?: string;
29 }) | undefined;
30}): string;
31declare function generateJSReferences({ files, publicPath, attributes, }: {
32 files: string[];
33 publicPath: string;
34 attributes: Attributes | undefined;
35}): string;
36declare function defaultTemplate({ css, js, publicPath, title, htmlAttributes, head, body, cssAttributes, jsAttributes, }: TemplateParameters): string;
37declare class MiniHtmlWebpackPlugin implements WebpackPluginInstance {
38 private options;
39 constructor(options: Options);
40 private webpack4plugin;
41 private webpack5plugin;
42 apply(compiler: webpack.Compiler): void;
43}
44export { MiniHtmlWebpackPlugin, defaultTemplate, generateAttributes, generateCSSReferences, generateJSReferences, };