UNPKG

1.15 kBTypeScriptView Raw
1import { Plugin } from "webpack";
2
3export = FriendlyErrorsWebpackPlugin;
4
5declare class FriendlyErrorsWebpackPlugin extends Plugin {
6 constructor(options?: FriendlyErrorsWebpackPlugin.Options);
7}
8
9declare namespace FriendlyErrorsWebpackPlugin {
10 type Severity = "error" | "warning";
11
12 interface Options {
13 compilationSuccessInfo?: {
14 messages: string[];
15 notes: string[];
16 } | undefined;
17
18 /**
19 * You can listen to errors transformed and prioritized by the plugin.
20 */
21 onErrors?(severity: Severity, errors: WebpackError[]): void;
22
23 /**
24 * Whether the console should be cleared between each compilation.
25 * @default true
26 */
27 clearConsole?: boolean | undefined;
28
29 additionalFormatters?: Array<(errors: WebpackError[], type: Severity) => string[]> | undefined;
30
31 additionalTransformers?: Array<(error: any) => any> | undefined;
32 }
33
34 interface WebpackError {
35 message: string;
36 file: string;
37 origin: string;
38 name: string;
39 severity: Severity;
40 webpackError: any;
41 }
42}