mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 22:59:10 +00:00
refactor(hmr): provide a separate logger interface (#15631)
This commit is contained in:
parent
5b4be42ad8
commit
110e2e1651
@ -15,6 +15,11 @@ interface HotCallback {
|
||||
fn: (modules: Array<ModuleNamespace | undefined>) => void
|
||||
}
|
||||
|
||||
export interface HMRLogger {
|
||||
error(msg: string | Error): void
|
||||
debug(...msg: unknown[]): void
|
||||
}
|
||||
|
||||
export interface HMRConnection {
|
||||
/**
|
||||
* Checked before sending messages to the client.
|
||||
@ -196,7 +201,7 @@ export class HMRClient {
|
||||
public messenger: HMRMessenger
|
||||
|
||||
constructor(
|
||||
public logger: Console,
|
||||
public logger: HMRLogger,
|
||||
connection: HMRConnection,
|
||||
// This allows implementing reloading via different methods depending on the environment
|
||||
private importUpdatedModule: (update: Update) => Promise<ModuleNamespace>,
|
||||
|
Loading…
Reference in New Issue
Block a user