1 |
|
2 | import HtmlWebpackPlugin from 'html-webpack-plugin';
|
3 | import { compilation, Configuration, Entry, EntryFunc, ExternalsElement, Options as WebpackOptions, Plugin, RuleSetRule } from 'webpack';
|
4 | export declare type HookReturn<T> = void | null | T | Promise<void | null | T>;
|
5 | export declare type Hook<T> = (input: T) => HookReturn<T>;
|
6 | export declare type Entries = string | Array<string> | Entry | EntryFunc;
|
7 | export declare type Externals = ExternalsElement | Array<ExternalsElement>;
|
8 | export declare type Target = 'web' | 'webworker' | 'node' | 'async-node' | 'node-webkit' | 'atom' | 'electron' | 'electron-renderer' | 'electron-main' | ((compiler?: any) => void);
|
9 | export declare type LibraryTarget = 'var' | 'this' | 'commonjs' | 'commonjs2' | 'amd' | 'umd' | 'window' | 'assign' | 'jsonp';
|
10 | export declare type FilenameGenerator = (data: OutputData) => string;
|
11 | export interface HtmlWebpackTrackerPluginParameters {
|
12 | outputName: string;
|
13 | plugin: HtmlWebpackPlugin.Options;
|
14 | }
|
15 | export interface OutputData {
|
16 | chunk: compilation.Chunk;
|
17 | hash: string;
|
18 | }
|
19 | export interface Output {
|
20 | filename?: string | FilenameGenerator;
|
21 | publicPath?: string;
|
22 | target?: Target;
|
23 | libraryTarget?: LibraryTarget;
|
24 | }
|
25 | export interface Environment {
|
26 | environment: string;
|
27 | version: string;
|
28 | serviceWorkerEnabled: boolean;
|
29 | [key: string]: any;
|
30 | }
|
31 | export interface Rules {
|
32 | additional?: Array<RuleSetRule>;
|
33 | babel?: boolean;
|
34 | typescript?: boolean;
|
35 | react?: boolean;
|
36 | images?: boolean;
|
37 | manifest?: boolean;
|
38 | robots?: boolean;
|
39 | afterHook?: Hook<Array<RuleSetRule>>;
|
40 | }
|
41 | export interface Plugins {
|
42 | additional?: Array<Plugin>;
|
43 | concatenate?: boolean;
|
44 | minify?: boolean;
|
45 | hotModuleReload?: boolean;
|
46 | splitChunks?: boolean | WebpackOptions.SplitChunksOptions;
|
47 | analyze?: boolean | string;
|
48 | afterHook?: Hook<Array<Plugin>>;
|
49 | }
|
50 | export interface IconsToLoad {
|
51 | [key: string]: Array<string>;
|
52 | }
|
53 | export interface Icons {
|
54 | tags: {
|
55 | [key: string]: string;
|
56 | };
|
57 | definitions: string;
|
58 | }
|
59 | export interface ServiceWorker {
|
60 | enabled?: boolean;
|
61 | src?: string;
|
62 | dest?: string;
|
63 | options?: object;
|
64 | debug?: boolean;
|
65 | }
|
66 | export interface Server {
|
67 | host?: string;
|
68 | port?: number;
|
69 | https?: boolean | {
|
70 | [key: string]: string | Buffer;
|
71 | };
|
72 | compress?: boolean;
|
73 | hot?: boolean | object;
|
74 | history?: boolean | object;
|
75 | disableHostCheck?: boolean;
|
76 | inline?: boolean;
|
77 | options?: object;
|
78 | afterHook?: Hook<Server>;
|
79 | }
|
80 | export interface Babel {
|
81 | browsersWhiteList?: string | Array<string> | {
|
82 | [key: string]: string;
|
83 | };
|
84 | removeFunctions?: Array<string>;
|
85 | exclude?: Array<string>;
|
86 | modules?: boolean;
|
87 | configuration?: any;
|
88 | envDebug?: boolean;
|
89 | }
|
90 | export declare type ExtendedConfiguration = Configuration & {
|
91 | output: any;
|
92 | devServer: any;
|
93 | };
|
94 | export interface Options extends Output {
|
95 | environment?: string | object;
|
96 | additionalEnvironment?: object;
|
97 | version?: string;
|
98 | env?: Environment;
|
99 | entries?: Entries;
|
100 | index?: boolean | string;
|
101 | rules?: Rules;
|
102 | plugins?: Plugins;
|
103 | stats?: WebpackOptions.Stats;
|
104 | performance?: WebpackOptions.Performance;
|
105 | icons?: IconsToLoad | Icons;
|
106 | serviceWorker?: ServiceWorker;
|
107 | srcFolder?: string;
|
108 | destFolder?: string;
|
109 | sourceMaps?: WebpackOptions.Devtool;
|
110 | externals?: Externals;
|
111 | server?: Server;
|
112 | babel?: Babel;
|
113 | useESModules?: boolean;
|
114 | uglify?: object;
|
115 | afterHook?: Hook<ExtendedConfiguration>;
|
116 | }
|