beesbuild
Version:
构建工具链
34 lines (33 loc) • 1.53 kB
TypeScript
import type { RollupWatchOptions as IRollupWatchOptions, OutputOptions as RollupOutputOptions, RollupWatcher, RollupWatcherEvent } from 'rollup';
import type { WatchOptions as ChokidarWatchOptions } from 'chokidar';
import type { RollupOutputKey } from '@beesbuild/utils';
import type { Bundle } from './types';
import type { BuildContext } from '../types';
export type RollupWatchOptions = Omit<IRollupWatchOptions, 'output'> & {
output: OutputOptions[];
};
declare const codeTypes: readonly ["FIRST_START", "FIRST_BUNDLE_START", "FIRST_BUNDLE_END", "FIRST_END", "FIRST_ERROR"];
export type RollupWatcherCodeTypes = RollupWatcherEvent['code'] | (typeof codeTypes)[number];
export type OutputOptions = RollupOutputOptions & {
_module: RollupOutputKey;
};
export declare const createRollupWatcher: (ctx: BuildContext, options: RollupWatchOptions, bundle: Bundle) => {
script?: undefined;
includes?: undefined;
watchOptions?: undefined;
watcher?: undefined;
writeBundle?: undefined;
} | {
script: string[];
includes: string[];
watchOptions: RollupWatchOptions;
watcher: RollupWatcher;
writeBundle: (files: string[]) => Promise<void>;
};
export type WatchOptions = Partial<ChokidarWatchOptions> & {
script: string | string[];
watcher?: RollupWatcher;
};
export declare const createChokidarWatcher: (options: WatchOptions) => any;
export declare const rollupWatch: (ctx: BuildContext, options: RollupWatchOptions, bundle: Bundle) => Promise<RollupWatcher | undefined>;
export {};