UNPKG

1.7 kBTypeScriptView Raw
1import webpack 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 Options = {
10 filename?: string;
11 publicPath?: string;
12 context?: Context;
13 template?: (args: Context | {
14 css: string;
15 js: string;
16 publicPath: string;
17 }) => string | Promise<string>;
18 chunks?: string[];
19};
20declare function generateAttributes(attributes?: {}): string;
21declare function generateCSSReferences({ files, publicPath, attributes, }: {
22 files: string[];
23 publicPath: string;
24 attributes: {
25 rel?: string;
26 };
27}): string;
28declare function generateJSReferences({ files, publicPath, attributes, }: {
29 files?: never[] | undefined;
30 publicPath?: string | undefined;
31 attributes?: {} | undefined;
32}): string;
33declare function defaultTemplate({ css, js, publicPath, title, htmlAttributes, head, body, cssAttributes, jsAttributes, }: {
34 css?: never[] | undefined;
35 js?: never[] | undefined;
36 publicPath?: string | undefined;
37 title?: string | undefined;
38 htmlAttributes?: {
39 lang: string;
40 } | undefined;
41 head?: string | undefined;
42 body?: string | undefined;
43 cssAttributes?: {} | undefined;
44 jsAttributes?: {} | undefined;
45}): string;
46declare class MiniHtmlWebpackPlugin implements webpack.Plugin {
47 private options;
48 constructor(options: Options);
49 private plugin;
50 apply(compiler: webpack.Compiler): void;
51}
52export { MiniHtmlWebpackPlugin as default, defaultTemplate, generateAttributes, generateCSSReferences, generateJSReferences, };