add dev API

This commit is contained in:
Rich Harris
2018-05-23 09:05:24 -04:00
parent 0dbf75f100
commit 1a4bace5f4
11 changed files with 520 additions and 327 deletions

40
src/api/interfaces.ts Normal file
View File

@@ -0,0 +1,40 @@
export type ReadyEvent = {
port: number;
};
export type ErrorEvent = {
type: string;
error: Error;
};
export type FatalEvent = {
error: Error;
};
export type InvalidEvent = {
changed: string[];
invalid: {
client: boolean;
server: boolean;
serviceworker: boolean;
}
};
export type BuildEvent = {
type: string;
errors: Array<{ message: string, duplicate: boolean }>;
warnings: Array<{ message: string, duplicate: boolean }>;
duration: number;
webpack_stats: any;
}
export type FileEvent = {
file: string;
size: number;
}
export type FailureEvent = {
}
export type DoneEvent = {}