UNPKG

@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.

28 lines (27 loc) 1.11 kB
import { FSWatcher } from 'chokidar'; import { Server } from '../../index.js'; import { Server as httpServer } from '../../server/type.js'; import WsServer from '../../server/ws.js'; import { CompilationContext, ViteModule } from '../type.js'; export declare class ViteDevServerAdapter { moduleGraph: ViteModuleGraphAdapter; config: any; pluginName: string; watcher: FSWatcher; middlewares: any; middlewareCallbacks: any[]; ws: WsServer; httpServer: httpServer; constructor(pluginName: string, config: any, server: Server); } export declare class ViteModuleGraphAdapter { context: CompilationContext; pluginName: string; constructor(pluginName: string); getModulesByFile(file: string): ViteModule[]; getModuleById(id: string): ViteModule; getModuleByUrl(url: string): Promise<ViteModule | undefined>; invalidateModule(): void; } export declare function createViteDevServerAdapter(pluginName: string, config: any, server: Server): ViteDevServerAdapter; export declare function createViteModuleGraphAdapter(pluginName: string): ViteModuleGraphAdapter;