@farmfe/core
Version:
Farm is a extremely fast web build tool written in Rust. Farm can start a project in milliseconds and perform HMR within 10ms, making it much faster than similar tools like webpack and vite.
62 lines (54 loc) • 1.02 kB
TypeScript
export type HMRPayload =
| ConnectedPayload
| UpdatePayload
| FullReloadPayload
| CustomPayload
| ErrorPayload
| PrunePayload;
export interface ConnectedPayload {
type: 'connected';
}
export interface UpdatePayload {
type: 'update';
updates: Update[];
}
export interface Update {
type: 'js-update' | 'css-update';
path: string;
acceptedPath: string;
timestamp: number;
/**
* @experimental internal
*/
explicitImportRequired?: boolean | undefined;
}
export interface PrunePayload {
type: 'prune';
paths: string[];
}
export interface FullReloadPayload {
type: 'full-reload';
path?: string;
}
export interface CustomPayload {
type: 'custom';
event: string;
data?: any;
}
export interface ErrorPayload {
type: 'error';
err: {
[name: string]: any;
message: string;
stack: string;
id?: string;
frame?: string;
plugin?: string;
pluginCode?: string;
loc?: {
file?: string;
line: number;
column: number;
};
};
}