/// import { Configuration } from 'webpack'; import { ConfigFileManager } from './ConfigFileManager'; import { CommandSchema, JuggConfig, JuggConfigChainFun, JuggGlobalCommandOpts, PluginCfgSchema, WebpackChainFun } from './interface'; import { Opts } from './utils/EventBus'; import { matchTranspileDependencies } from './utils/matchTranspileDependencies'; import readTs from './utils/readTs'; import { WebpackOptionsManager } from './webpack/options'; export default class Jugg { context: string; commands: CommandSchema[]; webpackChainFns: WebpackChainFun[]; juggConfigChainFns: JuggConfigChainFun[]; private webpackOptionsManager; private configFileManager; private fsWatcher; private eventBus; private commander; private juggConfig; private initialized; private globalCommandOpts; constructor(context: string); /** * user config */ readonly JConfig: Readonly; readonly IsProd: boolean; readonly WebpackOptionsManager: WebpackOptionsManager; readonly ConfigFileManager: ConfigFileManager; readonly Utils: { CHAIN_CONFIG_MAP: { entry: typeof import("./env/chainCfgMap").Entry; plugin: typeof import("./env/chainCfgMap").Plugin; rule: typeof import("./env/chainCfgMap").Rule; minimizer: typeof import("./env/chainCfgMap").Minimizer; other: typeof import("./env/chainCfgMap").Other; }; getAbsolutePath: (...p: string[]) => string; logger: import("./utils/logger").Logger; matchTranspileDependencies: typeof matchTranspileDependencies; readTs: typeof readTs; resolveCwd: any; resolvePlugin: (p: PluginCfgSchema) => any; }; readonly JGlobalCommandOpts: JuggGlobalCommandOpts; /** * 返回插件列表 * @param isAll 是否返回全部插件,否则隐去内置的插件 */ getPlugins(isAll?: boolean): Array<[string, any?]>; /** * 初始化 */ init(): void; /** * 加载插件 */ loadPlugins(): void; /** * merge config */ mergeConfig(): Configuration; /** * 注册监听配置文件变化 * @param callback 回调 */ onWatchConfigChange(callback: (p?: any) => void, opts?: Opts): void; /** * 清空、重新加载 */ reload(): void; /** * some thing should be close before exit * @deprecated */ exit(): void; /** * clean something */ clean(isExit?: boolean): void; /** * load env */ private loadEnv; /** * 注册命令行语句 */ private registerCommands; private resolveJuggConfigs; /** * handle file change but only config change will dispatch * @param _ path */ private handleConfigChange; private resolveGlobalCommandOpts; }