import { JSMinifier } from '@umijs/bundler-webpack/dist/types'; import { Minimatch } from 'minimatch'; import { IApi, IFatherBaseConfig, IFatherBuildTypes, IFatherBundleConfig, IFatherBundlessConfig, IFatherBundlessTypes, IFatherConfig } from '../types'; /** * declare bundler config */ export interface IBundleConfig extends IFatherBaseConfig, Omit { type: IFatherBuildTypes.BUNDLE; jsMinifier: JSMinifier; entry: string; output: { filename: string; path: string; }; } /** * declare bundless config */ export interface IBundlessConfig extends IFatherBaseConfig, Omit { type: IFatherBuildTypes.BUNDLESS; format: IFatherBundlessTypes; input: string; parallel: boolean; output: NonNullable; } /** * declare union builder config */ export type IBuilderConfig = IBundleConfig | IBundlessConfig; /** * generate bundle filename by package name */ export declare function getAutoBundleFilename(pkgName?: string): string; /** * * convert alias from tsconfig paths * @export * @param {string} cwd */ export declare function convertAliasByTsconfigPaths(cwd: string): { bundle: Record; bundless: Record; }; /** * normalize user config to bundler configs * @param userConfig config from user */ export declare function normalizeUserConfig(userConfig: IFatherConfig, pkg: IApi['pkg']): IBuilderConfig[]; declare class Minimatcher { matcher?: InstanceType; ignoreMatchers: InstanceType[]; constructor(pattern: string, ignores?: string[]); match(filePath: string): boolean; } declare class ConfigProvider { pkg: ConstructorParameters[0]; constructor(pkg: IApi['pkg']); onConfigChange(): void; } export declare class BundleConfigProvider extends ConfigProvider { type: IFatherBuildTypes; configs: IBundleConfig[]; constructor(configs: IBundleConfig[], pkg: ConstructorParameters[0]); } export declare class BundlessConfigProvider extends ConfigProvider { type: IFatherBuildTypes; configs: IBundlessConfig[]; input: string; output: string; matchers: InstanceType[]; constructor(configs: IBundlessConfig[], pkg: ConstructorParameters[0]); getConfigForFile(filePath: string): IBundlessConfig; } export declare function createConfigProviders(userConfig: IFatherConfig, pkg: IApi['pkg'], cwd: string): { bundless: { esm?: BundlessConfigProvider; cjs?: BundlessConfigProvider; }; bundle?: BundleConfigProvider | undefined; }; export {};