1 | import { AsyncSeriesHook, SyncHook, SyncWaterfallHook } from "tapable";
|
2 | import { compilation, Compiler, loader, Plugin, Stats } from "webpack";
|
3 |
|
4 | declare class WebpackAssetsManifest extends Plugin {
|
5 | constructor(options?: WebpackAssetsManifest.Options);
|
6 |
|
7 | /** https://github.com/webdeveric/webpack-assets-manifest#hooks */
|
8 | hooks: {
|
9 | apply: SyncHook<WebpackAssetsManifest>;
|
10 |
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | customize: SyncWaterfallHook<WebpackAssetsManifest.Entry, WebpackAssetsManifest.Entry, WebpackAssetsManifest>;
|
18 |
|
19 | transform: SyncWaterfallHook<WebpackAssetsManifest.Assets, WebpackAssetsManifest>;
|
20 |
|
21 | done: AsyncSeriesHook<WebpackAssetsManifest, Stats>;
|
22 |
|
23 | options: SyncWaterfallHook<WebpackAssetsManifest.Options>;
|
24 |
|
25 | afterOptions: SyncHook<WebpackAssetsManifest.Options>;
|
26 | };
|
27 |
|
28 |
|
29 | options: WebpackAssetsManifest.Options;
|
30 |
|
31 |
|
32 | assets: WebpackAssetsManifest.Assets;
|
33 |
|
34 |
|
35 | assetNames: Map<string, string>;
|
36 |
|
37 |
|
38 | currentAsset: compilation.Asset | null;
|
39 |
|
40 |
|
41 | compiler: Compiler | null;
|
42 |
|
43 |
|
44 | get defaultOptions(): WebpackAssetsManifest.Options;
|
45 |
|
46 |
|
47 | get isMerging(): boolean;
|
48 |
|
49 |
|
50 | getExtension(filename: string): string;
|
51 |
|
52 |
|
53 | fixKey(key: string): string;
|
54 |
|
55 |
|
56 | setRaw(key: string, value: unknown): this;
|
57 |
|
58 |
|
59 | set(key: string, value: unknown): this;
|
60 |
|
61 |
|
62 | has(key: string): boolean;
|
63 |
|
64 |
|
65 | get(key: string, defaultValue?: unknown): unknown;
|
66 |
|
67 |
|
68 | delete(key: string): boolean;
|
69 |
|
70 |
|
71 | processAssetsByChunkName(
|
72 | assets: Record<string, string | ReadonlyArray<string>>,
|
73 | hmrFiles?: Set<string>,
|
74 | ): this["assetNames"];
|
75 |
|
76 |
|
77 | toJSON(): unknown;
|
78 |
|
79 |
|
80 | toString(): string;
|
81 |
|
82 |
|
83 | maybeMerge(): void;
|
84 |
|
85 |
|
86 | emitAssetsManifest(compilation: compilation.Compilation): Promise<void>;
|
87 |
|
88 |
|
89 | getCompilationAssets(compilation: compilation.Compilation): { assets: compilation.Asset[]; hmrFiles: Set<string> };
|
90 |
|
91 |
|
92 | handleEmit(compilation: compilation.Compilation): Promise<void>;
|
93 |
|
94 |
|
95 | getManifestPath(compilation: compilation.Compilation, filename: string): string;
|
96 |
|
97 |
|
98 | writeTo(destination: string): Promise<void>;
|
99 |
|
100 | clear(): void;
|
101 |
|
102 |
|
103 | handleWatchRun(): void;
|
104 |
|
105 |
|
106 | shouldWriteToDisk(compilation: compilation.Compilation): boolean;
|
107 |
|
108 |
|
109 | handleAfterEmit(compilation: compilation.Compilation): Promise<void>;
|
110 |
|
111 |
|
112 | handleNormalModuleLoader(
|
113 | compilation: compilation.Compilation,
|
114 | loaderContext: loader.LoaderContext,
|
115 | module: compilation.Module,
|
116 | ): void;
|
117 |
|
118 | /** Add the SRI hash to the assetsInfo map */
|
119 | recordSubresourceIntegrity(compilation: compilation.Compilation): void;
|
120 |
|
121 | /** Hook into the compilation object */
|
122 | handleCompilation(compilation: compilation.Compilation): void;
|
123 |
|
124 | /**
|
125 | * Determine if webpack-dev-server is being used
|
126 | *
|
127 | * The WEBPACK_DEV_SERVER / WEBPACK_SERVE env vars cannot be relied upon.
|
128 | * See issue {@link https:
|
129 | */
|
130 | inDevServer(): boolean;
|
131 |
|
132 |
|
133 | getOutputPath(): string;
|
134 |
|
135 |
|
136 | getPublicPath(filename: string): string;
|
137 |
|
138 | |
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | getProxy(raw?: boolean): WebpackAssetsManifest.Assets;
|
145 | }
|
146 |
|
147 | declare namespace WebpackAssetsManifest {
|
148 | interface Options {
|
149 |
|
150 | enabled?: boolean | undefined;
|
151 |
|
152 |
|
153 | assets?: Assets | undefined;
|
154 |
|
155 |
|
156 | output?: string | undefined;
|
157 |
|
158 |
|
159 | replacer?:
|
160 | | ((this: unknown, key: string, value: unknown) => unknown)
|
161 | | ReadonlyArray<string | number>
|
162 | | null
|
163 | | undefined;
|
164 |
|
165 | /** https://github.com/webdeveric/webpack-assets-manifest#space */
|
166 | space?: number | string | undefined;
|
167 |
|
168 | /** https://github.com/webdeveric/webpack-assets-manifest#writetodisk */
|
169 | writeToDisk?: boolean | "auto" | undefined;
|
170 |
|
171 | /** https://github.com/webdeveric/webpack-assets-manifest#fileextregex */
|
172 | fileExtRegex?: RegExp | null | false | undefined;
|
173 |
|
174 | /** https://github.com/webdeveric/webpack-assets-manifest#sortmanifest */
|
175 | sortManifest?: boolean | ((this: WebpackAssetsManifest, a: string, b: string) => number) | undefined;
|
176 |
|
177 | /** https://github.com/webdeveric/webpack-assets-manifest#merge */
|
178 | merge?: boolean | "customize" | undefined;
|
179 |
|
180 | /** https://github.com/webdeveric/webpack-assets-manifest#publicpath */
|
181 | publicPath?:
|
182 | | string
|
183 | | boolean
|
184 | | null
|
185 | | ((filename: string, manifest: WebpackAssetsManifest) => string)
|
186 | | undefined;
|
187 |
|
188 | /** https://github.com/webdeveric/webpack-assets-manifest#contextrelativekeys */
|
189 | contextRelativeKeys?: boolean | undefined;
|
190 |
|
191 | /** https://github.com/webdeveric/webpack-assets-manifest#apply */
|
192 | apply?: ((manifest: WebpackAssetsManifest) => void) | null | undefined;
|
193 |
|
194 | /** https://github.com/webdeveric/webpack-assets-manifest#customize */
|
195 | customize?:
|
196 | | ((
|
197 | entry: Entry,
|
198 | original: Entry,
|
199 | manifest: WebpackAssetsManifest,
|
200 | asset: (compilation.Asset & { info: Record<string, any> }) | null,
|
201 | ) => Entry | false)
|
202 | | null
|
203 | | undefined;
|
204 |
|
205 | /** https://github.com/webdeveric/webpack-assets-manifest#transform */
|
206 | transform?: ((assets: Assets, manifest: WebpackAssetsManifest) => unknown) | null | undefined;
|
207 |
|
208 | /** https://github.com/webdeveric/webpack-assets-manifest#done */
|
209 | done?: ((manifest: WebpackAssetsManifest, stats: Stats) => void) | null | undefined;
|
210 |
|
211 | /** https://github.com/webdeveric/webpack-assets-manifest#entrypoints */
|
212 | entrypoints?: boolean | undefined;
|
213 |
|
214 | /** https://github.com/webdeveric/webpack-assets-manifest#entrypointskey */
|
215 | entrypointsKey?: string | false | undefined;
|
216 |
|
217 | /** https://github.com/webdeveric/webpack-assets-manifest#entrypointsuseassets */
|
218 | entrypointsUseAssets?: boolean | undefined;
|
219 |
|
220 | /** https://github.com/webdeveric/webpack-assets-manifest#integrity */
|
221 | integrity?: boolean | undefined;
|
222 |
|
223 | /** https://github.com/webdeveric/webpack-assets-manifest#integrityhashes */
|
224 | integrityHashes?: ReadonlyArray<string> | undefined;
|
225 |
|
226 | /** https://github.com/webdeveric/webpack-assets-manifest#integritypropertyname */
|
227 | integrityPropertyName?: string | undefined;
|
228 | }
|
229 |
|
230 | interface Entry {
|
231 | key: string;
|
232 | value: string;
|
233 | }
|
234 |
|
235 | interface Assets {
|
236 | [key: string]: unknown;
|
237 | }
|
238 | }
|
239 |
|
240 | export = WebpackAssetsManifest;
|
241 |
|
\ | No newline at end of file |