1 | import { Config as IDoczConfig } from 'docz-core';
|
2 |
|
3 | export type BundleType = 'rollup' | 'babel';
|
4 |
|
5 | interface IBundleTypeOutput {
|
6 | type: BundleType;
|
7 | file?: string;
|
8 | }
|
9 |
|
10 | interface ICjs extends IBundleTypeOutput {
|
11 | minify?: boolean;
|
12 | }
|
13 |
|
14 | interface IEsm extends IBundleTypeOutput {
|
15 | mjs?: boolean;
|
16 | minify?: boolean;
|
17 | }
|
18 |
|
19 | interface IStringObject {
|
20 | [prop: string]: string;
|
21 | }
|
22 |
|
23 | interface IStringArrayObject {
|
24 | [prop: string]: string[];
|
25 | }
|
26 |
|
27 | interface IUmd {
|
28 | globals?: IStringObject;
|
29 | name?: string;
|
30 | minFile?: boolean;
|
31 | file?: string;
|
32 | }
|
33 |
|
34 | export interface IBundleOptions {
|
35 | entry?: string | string[];
|
36 | file?: string;
|
37 | esm?: BundleType | IEsm | false;
|
38 | cjs?: BundleType | ICjs | false;
|
39 | umd?: IUmd | false;
|
40 | extraBabelPlugins?: any[];
|
41 | extraBabelPresets?: any[];
|
42 | extraPostCSSPlugins?: any[];
|
43 | cssModules?: boolean | Object;
|
44 | autoprefixer?: Object;
|
45 | namedExports?: IStringArrayObject;
|
46 | runtimeHelpers?: boolean;
|
47 | target?: 'node' | 'browser';
|
48 | overridesByEntry?: {
|
49 | [entry: string]: any;
|
50 | };
|
51 | doc?: IDoczConfig;
|
52 | replace?: {
|
53 | [value: string]: any;
|
54 | };
|
55 | }
|
56 |
|
57 | export interface IOpts {
|
58 | cwd: string;
|
59 | watch?: boolean;
|
60 | buildArgs?: IBundleOptions;
|
61 | }
|