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