UNPKG

4.26 kBTypeScriptView Raw
1/**
2 * @additionalProperties false
3 */
4export interface BeforeBuildCleanOptions {
5 /**
6 * If true, delete output directory before build.
7 */
8 cleanOutDir?: boolean;
9 /**
10 * If true, delete cache directories before build.
11 */
12 cleanCache?: boolean;
13 /**
14 * Paths to be deleted.
15 */
16 paths?: string[];
17 /**
18 * Path array to exclude from deleting.
19 */
20 excludes?: string[];
21}
22/**
23 * @additionalProperties false
24 */
25export interface AfterEmitCleanOptions {
26 /**
27 * Paths to be deleted.
28 */
29 paths?: string[];
30 /**
31 * Path array to exclude from deleting.
32 */
33 excludes?: string[];
34}
35/**
36 * @additionalProperties false
37 */
38export interface CleanOptions {
39 /**
40 * Before build clean option.
41 */
42 beforeBuild?: BeforeBuildCleanOptions;
43 /**
44 * After emit clean option.
45 */
46 afterEmit?: AfterEmitCleanOptions;
47 /**
48 * Allows cleaning outside of output directory.
49 */
50 allowOutsideOutDir?: boolean;
51 /**
52 * Allows cleaning outside of workspace root.
53 */
54 allowOutsideWorkspaceRoot?: boolean;
55}
56/**
57 * @additionalProperties false
58 */
59export interface AssetEntry {
60 /**
61 * The source file, it can be absolute or relative path or glob pattern.
62 */
63 from: string;
64 /**
65 * The output file name.
66 */
67 to?: string;
68 /**
69 * The ignore list.
70 */
71 exclude?: string[];
72}
73/**
74 * @additionalProperties false
75 */
76export interface GlobalEntry {
77 /**
78 * The file to include.
79 */
80 input: string | string[];
81 /**
82 * The bundle name for this extra entry point.
83 */
84 bundleName?: string;
85 /**
86 * If the bundle will be lazy loaded.
87 */
88 lazy?: boolean;
89}
90export interface ExternalsObjectElement {
91 [key: string]: boolean | string | {
92 commonjs: string;
93 amd: string;
94 root: string;
95 [key: string]: string | boolean;
96 };
97}
98export declare type ExternalsEntry = string | ExternalsObjectElement;
99/**
100 * @additionalProperties false
101 */
102export interface StylePreprocessorOptions {
103 /**
104 * An array of paths that LibSass can look in to attempt to resolve your @import declarations.
105 */
106 includePaths: string[];
107}
108export interface EnvOverridesOptions<TConfig extends ProjectConfigBase> {
109 [name: string]: TConfig;
110}
111/**
112 * @additionalProperties false
113 */
114export interface ProjectConfigBase {
115 /**
116 * The output directory for build results.
117 */
118 outputPath?: string;
119 /**
120 * Tell the build system which platform environment the application is targeting.
121 */
122 platformTarget?: 'web' | 'node';
123 /**
124 * Clean options.
125 */
126 clean?: CleanOptions | boolean;
127 /**
128 * Copy options.
129 */
130 copy?: (string | AssetEntry)[];
131 /**
132 * List of global style entries.
133 */
134 styles?: (string | GlobalEntry)[];
135 /**
136 * Options to pass to style preprocessors.
137 */
138 stylePreprocessorOptions?: StylePreprocessorOptions;
139 /**
140 * The typescript configuration file to be used.
141 */
142 tsConfig?: string;
143 /**
144 * Banner text to add at the top of each generated files. It can be text file name or raw text.
145 */
146 banner?: string;
147 /**
148 * If true, sourcemaps will be generated.
149 */
150 sourceMap?: boolean;
151 /**
152 * If true, this project config will be skipped by the build process.
153 */
154 skip?: boolean;
155}
156/**
157 * @additionalProperties false
158 */
159export interface ProjectConfig<TConfig extends ProjectConfigBase> extends ProjectConfigBase {
160 /**
161 * Link to schema.
162 */
163 $schema?: string;
164 /**
165 * The name of this configuration.
166 */
167 name?: string;
168 /**
169 * The name of build-in configuration preset, or path(s) to other configuration files which are extended by this configuration.
170 */
171 extends?: string | string[];
172 /**
173 * The project root folder.
174 */
175 root?: string;
176 /**
177 * To override properties based on build environment.
178 */
179 envOverrides?: EnvOverridesOptions<TConfig>;
180}