UNPKG

11.8 kBTypeScriptView Raw
1/**
2 * Browser target options
3 */
4export interface Schema {
5 /**
6 * A list of CommonJS packages that are allowed to be used without a build time warning.
7 */
8 allowedCommonJsDependencies?: string[];
9 /**
10 * Build using Ahead of Time compilation.
11 */
12 aot?: boolean;
13 /**
14 * List of static application assets.
15 */
16 assets?: AssetPattern[];
17 /**
18 * Base url for the application being built.
19 */
20 baseHref?: string;
21 /**
22 * Budget thresholds to ensure parts of your application stay within boundaries which you
23 * set.
24 */
25 budgets?: Budget[];
26 /**
27 * Enables advanced build optimizations when using the 'aot' option.
28 */
29 buildOptimizer?: boolean;
30 /**
31 * Generate a seperate bundle containing code used across multiple bundles.
32 */
33 commonChunk?: boolean;
34 /**
35 * Define the crossorigin attribute setting of elements that provide CORS support.
36 */
37 crossOrigin?: CrossOrigin;
38 /**
39 * Delete the output path before building.
40 */
41 deleteOutputPath?: boolean;
42 /**
43 * URL where files will be deployed.
44 * @deprecated Use "baseHref" option, "APP_BASE_HREF" DI token or a combination of both
45 * instead. For more information, see https://angular.io/guide/deployment#the-deploy-url.
46 */
47 deployUrl?: string;
48 /**
49 * Extract all licenses in a separate file.
50 */
51 extractLicenses?: boolean;
52 /**
53 * Replace compilation source files with other compilation source files in the build.
54 */
55 fileReplacements?: FileReplacement[];
56 /**
57 * How to handle duplicate translations for i18n.
58 */
59 i18nDuplicateTranslation?: I18NTranslation;
60 /**
61 * How to handle missing translations for i18n.
62 */
63 i18nMissingTranslation?: I18NTranslation;
64 /**
65 * Configures the generation of the application's HTML index.
66 */
67 index: IndexUnion;
68 /**
69 * The stylesheet language to use for the application's inline component styles.
70 */
71 inlineStyleLanguage?: InlineStyleLanguage;
72 /**
73 * Translate the bundles in one or more locales.
74 */
75 localize?: Localize;
76 /**
77 * The full path for the main entry point to the app, relative to the current workspace.
78 */
79 main: string;
80 /**
81 * Use file name for lazy loaded chunks.
82 */
83 namedChunks?: boolean;
84 /**
85 * Path to ngsw-config.json.
86 */
87 ngswConfigPath?: string;
88 /**
89 * Enables optimization of the build output. Including minification of scripts and styles,
90 * tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For
91 * more information, see
92 * https://angular.io/guide/workspace-config#optimization-configuration.
93 */
94 optimization?: OptimizationUnion;
95 /**
96 * Define the output filename cache-busting hashing mode.
97 */
98 outputHashing?: OutputHashing;
99 /**
100 * The full path for the new output directory, relative to the current workspace.
101 * By default, writes output to a folder named dist/ in the current project.
102 */
103 outputPath: string;
104 /**
105 * Enable and define the file watching poll time period in milliseconds.
106 */
107 poll?: number;
108 /**
109 * Polyfills to be included in the build.
110 */
111 polyfills?: Polyfills;
112 /**
113 * Do not use the real path when resolving modules. If unset then will default to `true` if
114 * NodeJS option --preserve-symlinks is set.
115 */
116 preserveSymlinks?: boolean;
117 /**
118 * Log progress to the console while building.
119 */
120 progress?: boolean;
121 /**
122 * The path where style resources will be placed, relative to outputPath.
123 */
124 resourcesOutputPath?: string;
125 /**
126 * Global scripts to be included in the build.
127 */
128 scripts?: ScriptElement[];
129 /**
130 * Generates a service worker config for production builds.
131 */
132 serviceWorker?: boolean;
133 /**
134 * Output source maps for scripts and styles. For more information, see
135 * https://angular.io/guide/workspace-config#source-map-configuration.
136 */
137 sourceMap?: SourceMapUnion;
138 /**
139 * Generates a 'stats.json' file which can be analyzed using tools such as
140 * 'webpack-bundle-analyzer'.
141 */
142 statsJson?: boolean;
143 /**
144 * Options to pass to style preprocessors.
145 */
146 stylePreprocessorOptions?: StylePreprocessorOptions;
147 /**
148 * Global styles to be included in the build.
149 */
150 styles?: StyleElement[];
151 /**
152 * Enables the use of subresource integrity validation.
153 */
154 subresourceIntegrity?: boolean;
155 /**
156 * The full path for the TypeScript configuration file, relative to the current workspace.
157 */
158 tsConfig: string;
159 /**
160 * Generate a seperate bundle containing only vendor libraries. This option should only be
161 * used for development to reduce the incremental compilation time.
162 */
163 vendorChunk?: boolean;
164 /**
165 * Adds more details to output logging.
166 */
167 verbose?: boolean;
168 /**
169 * Run build when files change.
170 */
171 watch?: boolean;
172 /**
173 * TypeScript configuration for Web Worker modules.
174 */
175 webWorkerTsConfig?: string;
176}
177export type AssetPattern = AssetPatternClass | string;
178export interface AssetPatternClass {
179 /**
180 * Allow glob patterns to follow symlink directories. This allows subdirectories of the
181 * symlink to be searched.
182 */
183 followSymlinks?: boolean;
184 /**
185 * The pattern to match.
186 */
187 glob: string;
188 /**
189 * An array of globs to ignore.
190 */
191 ignore?: string[];
192 /**
193 * The input directory path in which to apply 'glob'. Defaults to the project root.
194 */
195 input: string;
196 /**
197 * Absolute path within the output.
198 */
199 output: string;
200}
201export interface Budget {
202 /**
203 * The baseline size for comparison.
204 */
205 baseline?: string;
206 /**
207 * The threshold for error relative to the baseline (min & max).
208 */
209 error?: string;
210 /**
211 * The maximum threshold for error relative to the baseline.
212 */
213 maximumError?: string;
214 /**
215 * The maximum threshold for warning relative to the baseline.
216 */
217 maximumWarning?: string;
218 /**
219 * The minimum threshold for error relative to the baseline.
220 */
221 minimumError?: string;
222 /**
223 * The minimum threshold for warning relative to the baseline.
224 */
225 minimumWarning?: string;
226 /**
227 * The name of the bundle.
228 */
229 name?: string;
230 /**
231 * The type of budget.
232 */
233 type: Type;
234 /**
235 * The threshold for warning relative to the baseline (min & max).
236 */
237 warning?: string;
238}
239/**
240 * The type of budget.
241 */
242export declare enum Type {
243 All = "all",
244 AllScript = "allScript",
245 Any = "any",
246 AnyComponentStyle = "anyComponentStyle",
247 AnyScript = "anyScript",
248 Bundle = "bundle",
249 Initial = "initial"
250}
251/**
252 * Define the crossorigin attribute setting of elements that provide CORS support.
253 */
254export declare enum CrossOrigin {
255 Anonymous = "anonymous",
256 None = "none",
257 UseCredentials = "use-credentials"
258}
259export interface FileReplacement {
260 replace?: string;
261 replaceWith?: string;
262 src?: string;
263 with?: string;
264}
265/**
266 * How to handle duplicate translations for i18n.
267 *
268 * How to handle missing translations for i18n.
269 */
270export declare enum I18NTranslation {
271 Error = "error",
272 Ignore = "ignore",
273 Warning = "warning"
274}
275/**
276 * Configures the generation of the application's HTML index.
277 */
278export type IndexUnion = IndexObject | string;
279export interface IndexObject {
280 /**
281 * The path of a file to use for the application's generated HTML index.
282 */
283 input: string;
284 /**
285 * The output path of the application's generated HTML index file. The full provided path
286 * will be used and will be considered relative to the application's configured output path.
287 */
288 output?: string;
289}
290/**
291 * The stylesheet language to use for the application's inline component styles.
292 */
293export declare enum InlineStyleLanguage {
294 Css = "css",
295 Less = "less",
296 Sass = "sass",
297 Scss = "scss"
298}
299/**
300 * Translate the bundles in one or more locales.
301 */
302export type Localize = string[] | boolean;
303/**
304 * Enables optimization of the build output. Including minification of scripts and styles,
305 * tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For
306 * more information, see
307 * https://angular.io/guide/workspace-config#optimization-configuration.
308 */
309export type OptimizationUnion = boolean | OptimizationClass;
310export interface OptimizationClass {
311 /**
312 * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY`
313 * environment variable can be used to specify a proxy server.
314 */
315 fonts?: FontsUnion;
316 /**
317 * Enables optimization of the scripts output.
318 */
319 scripts?: boolean;
320 /**
321 * Enables optimization of the styles output.
322 */
323 styles?: StylesUnion;
324}
325/**
326 * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY`
327 * environment variable can be used to specify a proxy server.
328 */
329export type FontsUnion = boolean | FontsClass;
330export interface FontsClass {
331 /**
332 * Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS
333 * definitions in the application's HTML index file. This option requires internet access.
334 * `HTTPS_PROXY` environment variable can be used to specify a proxy server.
335 */
336 inline?: boolean;
337}
338/**
339 * Enables optimization of the styles output.
340 */
341export type StylesUnion = boolean | StylesClass;
342export interface StylesClass {
343 /**
344 * Extract and inline critical CSS definitions to improve first paint time.
345 */
346 inlineCritical?: boolean;
347 /**
348 * Minify CSS definitions by removing extraneous whitespace and comments, merging
349 * identifiers and minimizing values.
350 */
351 minify?: boolean;
352}
353/**
354 * Define the output filename cache-busting hashing mode.
355 */
356export declare enum OutputHashing {
357 All = "all",
358 Bundles = "bundles",
359 Media = "media",
360 None = "none"
361}
362/**
363 * Polyfills to be included in the build.
364 */
365export type Polyfills = string[] | string;
366export type ScriptElement = ScriptClass | string;
367export interface ScriptClass {
368 /**
369 * The bundle name for this extra entry point.
370 */
371 bundleName?: string;
372 /**
373 * If the bundle will be referenced in the HTML file.
374 */
375 inject?: boolean;
376 /**
377 * The file to include.
378 */
379 input: string;
380}
381/**
382 * Output source maps for scripts and styles. For more information, see
383 * https://angular.io/guide/workspace-config#source-map-configuration.
384 */
385export type SourceMapUnion = boolean | SourceMapClass;
386export interface SourceMapClass {
387 /**
388 * Output source maps used for error reporting tools.
389 */
390 hidden?: boolean;
391 /**
392 * Output source maps for all scripts.
393 */
394 scripts?: boolean;
395 /**
396 * Output source maps for all styles.
397 */
398 styles?: boolean;
399 /**
400 * Resolve vendor packages source maps.
401 */
402 vendor?: boolean;
403}
404/**
405 * Options to pass to style preprocessors.
406 */
407export interface StylePreprocessorOptions {
408 /**
409 * Paths to include. Paths will be resolved to workspace root.
410 */
411 includePaths?: string[];
412}
413export type StyleElement = StyleClass | string;
414export interface StyleClass {
415 /**
416 * The bundle name for this extra entry point.
417 */
418 bundleName?: string;
419 /**
420 * If the bundle will be referenced in the HTML file.
421 */
422 inject?: boolean;
423 /**
424 * The file to include.
425 */
426 input: string;
427}