UNPKG

895 BTypeScriptView Raw
1import type { IProjectConfig } from '@tarojs/taro/types/compile';
2import type { CompilerTypes, CompilerWebpackTypes } from '@tarojs/taro/types/compile/compiler';
3type WebpackMerge = (...configs: Array<object | null | undefined>) => object;
4export interface ConfigEnv {
5 /** taro 当前执行的命令 */
6 command: string;
7 /** 当前模式 (mode) */
8 mode: string;
9}
10export type UserConfigFn<T extends CompilerTypes = CompilerWebpackTypes> = (merge: WebpackMerge, env: ConfigEnv) => IProjectConfig<T> | Promise<IProjectConfig<T>>;
11export type UserConfigExport<T extends CompilerTypes = CompilerWebpackTypes> = IProjectConfig<T> | Promise<IProjectConfig<T>> | UserConfigFn;
12/**
13 * @since v3.6.9
14 * @warning 暂不支持 react native
15 */
16export declare function defineConfig<T extends CompilerTypes = CompilerWebpackTypes>(config: UserConfigExport<T>): UserConfigExport<T>;
17export {};