UNPKG

1.28 kBTypeScriptView Raw
1export declare type Milliseconds = number;
2export declare type Bytes = number;
3export declare type Path = string;
4export interface WebpackAsset {
5 name: string;
6 size: Bytes;
7 chunks: number[];
8 chunkNames: string[];
9 emitted: boolean;
10}
11export interface WebpackChunk {
12}
13export interface WebpackModule {
14 id: number;
15 identifier: Path;
16 name: string;
17 size: Bytes;
18}
19export interface CompilationBase {
20 name?: string;
21 errors: any[];
22 hash: string;
23 version: string;
24 warnings: any[];
25}
26/** JSON structure produced when Webpack config
27 * is an array of bundles.
28 */
29export interface WebpackMultiCompilation extends CompilationBase {
30 children: WebpackCompilation[];
31}
32/** JSON structure produced for a single bundle generated by
33 * a Webpack compilation.
34 */
35export interface WebpackCompilation extends CompilationBase {
36 time: Milliseconds;
37 assetsByChunkName: {
38 [chunkName: string]: string;
39 };
40 assets: WebpackAsset[];
41 chunks: WebpackChunk[];
42 modules: WebpackModule[];
43}
44/** JSON structure of `webpack --json` output */
45export declare type WebpackStats = WebpackMultiCompilation | WebpackCompilation;
46export declare function isMultiCompilation(stats: WebpackStats): stats is WebpackMultiCompilation;