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