UNPKG

mp-lens

Version:

微信小程序分析工具 (Unused Code, Dependencies, Visualization)

34 lines (33 loc) 1.15 kB
import { ConfigFileOptions } from '../types/command-options'; /** * Loads the mp-lens specific configuration file (e.g., mp-lens.config.js). * It does NOT handle loading tsconfig.json or other project-specific config files. */ export declare class ConfigLoader { /** * 从指定路径加载配置文件 * @param configPath 配置文件路径,如果未提供,将自动搜索 * @param projectRoot 项目根目录 * @returns 配置对象或null(未找到配置文件) */ static loadConfig(configPath?: string, projectRoot?: string): Promise<ConfigFileOptions | null>; /** * 根据文件类型加载配置文件 * @param filePath 配置文件路径 * @returns 配置对象 */ private static loadConfigFile; /** * 加载JSON格式的配置文件 */ private static loadJsonConfig; /** * 加载JavaScript格式的配置文件 */ private static loadJavaScriptConfig; /** * 加载TypeScript格式的配置文件 * 注意:需要项目中安装ts-node才能直接执行TypeScript文件 */ private static loadTypeScriptConfig; }