-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
61 lines (52 loc) · 1.59 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { Source } from "webpack-sources";
type RawContent = string | Buffer | Source | any;
type Content = RawContent |
((assets: Record<string, Source>) => RawContent) |
((assets: Record<string, Source>) => Promise<RawContent>);
/**
* The EmitFilePlugin config.
*/
declare class EmitFilePluginOptions {
/**
* OPTIONAL: defaults to the Webpack output path.
* Output path.
* Can be relative (to Webpack output path) or absolute.
*/
path?: string;
/**
* REQUIRED.
* Name of the file to add to assets.
*/
filename: string;
/**
* OPTIONAL: defaults to false.
* Adds the compilation hash to the filename. You can either choose within the filename
* where the hash is inserted by adding `[hash]` i.e. `test.[hash].js` or the hash will be
* appended to the end of the file i.e. `test.js?hash`.
*/
hash?: boolean;
/**
* OPTIONAL: defaults to the webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL.
* Asset processing stage.
*/
stage?: number;
/**
* REQUIRED.
* File content. Can be either a string, a buffer, or a (asynchronous) function.
* If the resulting object is not a string or a buffer, it will be converted
* to string via `.toString` (if the function was overridden) or `JSON.stringify`.
*/
content: Content;
}
/**
* Webpack plugin to emit files.
*/
declare class EmitFilePlugin {
/**
* Webpack plugin to emit files.
*
* @param options The EmitFilePlugin config.
*/
constructor(options: EmitFilePluginOptions);
}
export = EmitFilePlugin;