-
Notifications
You must be signed in to change notification settings - Fork 2.7k
/
Copy pathtypes.ts
56 lines (51 loc) · 1.42 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import {
BuildOptions,
TransformOptions,
} from '@umijs/bundler-utils/compiled/esbuild';
import type { Plugin } from '@umijs/bundler-vite/compiled/vite';
export enum Env {
development = 'development',
production = 'production',
}
export enum JSMinifier {
terser = 'terser',
esbuild = 'esbuild',
}
export interface ICopy {
from: string;
to: string;
}
export type IBabelPlugin =
| Function
| string
| [string, { [key: string]: any }]
| [string, [{ [key: string]: any }]]
| [string, { [key: string]: any }, string]
| [string, [{ [key: string]: any }], string];
export interface IConfig {
alias?: Record<string, string>;
autoCSSModules?: boolean;
autoprefixer?: any;
copy?: ICopy[] | string[];
define?: { [key: string]: any };
extraBabelPlugins?: IBabelPlugin[];
extraBabelPresets?: IBabelPlugin[];
extraPostCSSPlugins?: any[];
extraVitePlugins?: Plugin[];
hash?: boolean;
inlineLimit?: number;
manifest?: boolean;
normalCSSLoaderModules?: { [key: string]: any };
jsMinifier?: JSMinifier | boolean;
jsMinifierOptions?: { [key: string]: any };
lessLoader?: { lessOptions: any };
outputPath?: string;
polyfill?: { imports: string[] };
postcssLoader?: { postcssOptions: any };
publicPath?: string;
svgr?: TransformOptions;
targets?: { [key: string]: any };
loader?: BuildOptions['loader'];
modifyConfig?: (config: BuildOptions) => void | Promise<void>;
[key: string]: any;
}