1 | import { SyncWaterfallHook } from "tapable";
|
2 | import { Chunk, Compiler, WebpackPluginInstance } from "webpack";
|
3 |
|
4 | export const WebpackManifestPlugin: {
|
5 | new(options?: Options): WebpackPluginInstance;
|
6 | };
|
7 |
|
8 | export interface FileDescriptor {
|
9 |
|
10 | chunk?: Chunk | undefined;
|
11 | isAsset: boolean;
|
12 | isChunk: boolean;
|
13 |
|
14 | isInitial: boolean;
|
15 |
|
16 | isModuleAsset: boolean;
|
17 | name: string | null;
|
18 | path: string;
|
19 | }
|
20 |
|
21 | export interface Options {
|
22 | |
23 |
|
24 |
|
25 |
|
26 | basePath?: string | undefined;
|
27 |
|
28 | |
29 |
|
30 |
|
31 |
|
32 | fileName?: string | undefined;
|
33 |
|
34 | |
35 |
|
36 |
|
37 | filter?: ((file: FileDescriptor) => boolean) | undefined;
|
38 |
|
39 | /**
|
40 | * Create the manifest. It can return anything as long as it's serializable by JSON.stringify.
|
41 | */
|
42 | generate?: ((seed: object, files: FileDescriptor[], entries: Record<string, string[]>) => object) | undefined;
|
43 |
|
44 | /**
|
45 | * Modify file details before the manifest is created.
|
46 | */
|
47 | map?: ((file: FileDescriptor) => FileDescriptor) | undefined;
|
48 |
|
49 | /**
|
50 | * A path prefix that will be added to values of the manifest.
|
51 | * Default: output.publicPath
|
52 | */
|
53 | publicPath?: string | undefined;
|
54 |
|
55 | /**
|
56 | * Remove hashes from manifest keys. Defaults to Webpack's md5 hash.
|
57 | * Default: /([a-f0-9]{32}\.?)/gi
|
58 | */
|
59 | removeKeyHash?: RegExp | boolean | undefined;
|
60 |
|
61 | /**
|
62 | * A cache of key/value pairs to used to seed the manifest.
|
63 | * Default: {}
|
64 | */
|
65 | seed?: object | undefined;
|
66 |
|
67 | /**
|
68 | * Output manifest file in different format then json (i.e. yaml).
|
69 | */
|
70 | serialize?: ((manifest: object) => string) | undefined;
|
71 |
|
72 | /**
|
73 | * Sort files before they are passed to generate.
|
74 | */
|
75 | sort?: ((fileA: FileDescriptor, fileB: FileDescriptor) => number) | undefined;
|
76 |
|
77 | /**
|
78 | * If true, the keys specified in the entry property will be used as keys in the manifest.
|
79 | * Default: false
|
80 | */
|
81 | useEntryKeys?: boolean | undefined;
|
82 |
|
83 | /**
|
84 | * If set to true will emit to build folder and memory in combination with webpack-dev-server.
|
85 | * Default: false
|
86 | */
|
87 | writeToFileEmit?: boolean | undefined;
|
88 | }
|
89 |
|
90 | export function getCompilerHooks(compiler: Compiler): { afterEmit: SyncWaterfallHook; beforeEmit: SyncWaterfallHook };
|
91 |
|
\ | No newline at end of file |