UNPKG

9.85 kBTypeScriptView Raw
1import { ExternalsEntry, GlobalEntry, ProjectConfig, ProjectConfigBase } from './project-config';
2/**
3 * @additionalProperties false
4 */
5export interface HtmlInjectOptions {
6 runtimeChunkInline?: boolean;
7 dlls?: boolean;
8 resourceHints?: boolean;
9 index?: string;
10 indexOut?: string;
11 baseHrefOut?: string;
12 resourceHintsOut?: string;
13 stylesOut?: string;
14 runtimeInlineOut?: string;
15 scriptsOut?: string;
16 preloads?: string[];
17 prefetches?: string[];
18 customAttributes?: {
19 [key: string]: string;
20 };
21 customScriptAttributes?: {
22 [key: string]: string;
23 };
24 customLinkAttributes?: {
25 [key: string]: string;
26 };
27 customResourceHintAttributes?: {
28 [key: string]: string;
29 };
30 minify?: boolean;
31}
32/**
33 * @additionalProperties false
34 */
35export interface OutputHashingOptions {
36 bundles?: boolean;
37 chunks?: boolean;
38 extractedAssets?: boolean;
39}
40export declare enum OutputHashingCompat {
41 All = "all",
42 Bundles = "bundles",
43 Media = "media",
44 None = "none"
45}
46/**
47 * @additionalProperties false
48 */
49export interface PerformanceOptions {
50 hints?: 'warning' | 'error' | boolean;
51 maxAssetSize?: number;
52 maxEntrypointSize?: number;
53}
54/**
55 * @additionalProperties false
56 */
57export interface FileReplacementEntry {
58 replace: string;
59 with: string;
60}
61/**
62 * @additionalProperties false
63 */
64export interface BundleAnalyzerOptions {
65 /**
66 * Path to bundle report file that will be generated in `static` mode.
67 */
68 reportFilename?: string;
69 /**
70 * If `true`, Webpack Stats JSON file will be generated in bundles output directory.
71 */
72 generateStatsFile?: boolean;
73 /**
74 * Name of Webpack Stats JSON file that will be generated if `generateStatsFile` is `true`.
75 */
76 statsFilename?: string;
77 /**
78 * If true, automatically open report in default browser.
79 */
80 openAnalyzer?: boolean;
81}
82export declare type WebpackStatsPreset = boolean | 'errors-only' | 'minimal' | 'none' | 'normal' | 'verbose';
83export interface WebpackStatsToJsonOptions {
84 assets?: boolean;
85 assetsSort?: string;
86 cached?: boolean;
87 cachedAssets?: boolean;
88 children?: boolean;
89 chunkModules?: boolean;
90 chunkOrigins?: boolean;
91 chunks?: boolean;
92 chunksSort?: string;
93 context?: string;
94 depth?: boolean;
95 entrypoints?: boolean;
96 env?: boolean;
97 errors?: boolean;
98 errorDetails?: boolean;
99 excludeAssets?: string | string[];
100 excludeModules?: string | string[];
101 exclude?: string | string[];
102 hash?: boolean;
103 maxModules?: number;
104 modules?: boolean;
105 modulesSort?: string;
106 moduleTrace?: boolean;
107 publicPath?: boolean;
108 reasons?: boolean;
109 source?: boolean;
110 timings?: boolean;
111 version?: boolean;
112 warnings?: boolean;
113 usedExports?: boolean;
114 warningsFilter?: string | string[];
115 performance?: boolean;
116 providedExports?: boolean;
117}
118export interface WebpackStatsToStringOptions extends WebpackStatsToJsonOptions {
119 colors?: boolean;
120}
121/**
122 * @additionalProperties false
123 */
124export interface AppProjectConfigBase extends ProjectConfigBase {
125 /**
126 * Global script entries.
127 */
128 scripts?: (string | GlobalEntry)[];
129 /**
130 * Polyfill entries.
131 */
132 polyfills?: string[] | string;
133 /**
134 * The vendor module entries for dll bundle.
135 */
136 vendors?: string[];
137 /**
138 * Module format for bundling.
139 */
140 libraryTarget?: 'var' | 'commonjs' | 'commonjs2' | 'umd';
141 /**
142 * The main typescript entry file to be bundled.
143 */
144 entry?: string;
145 /**
146 * If true, requested modules started with node_modules path are chunk into [vendorChunkName].js.
147 */
148 vendorChunk?: boolean;
149 /**
150 * If true, chunk a separate bundle containing common code used across multiple bundles.
151 */
152 commonChunk?: boolean;
153 /**
154 * The output chunk name for main entry.
155 */
156 mainChunkName?: string;
157 /**
158 * The output chunk name for polyfills.
159 */
160 polyfillsChunkName?: string;
161 /**
162 * The output chunk name for vendor or dll chunk.
163 */
164 vendorChunkName?: string;
165 /**
166 * The html injection options.
167 */
168 htmlInject?: HtmlInjectOptions;
169 /**
170 * The url where files will be deployed.
171 */
172 publicPath?: string;
173 /**
174 * The base URL for all relative URLs on a page.
175 */
176 baseHref?: string;
177 /**
178 * To consume dll bundle created by the dll build.
179 */
180 referenceDll?: boolean;
181 /**
182 * Build using Ahead of Time compilation.
183 */
184 aot?: boolean;
185 /**
186 * Define the output filename cache-busting hashing mode.
187 */
188 outputHashing?: OutputHashingOptions | OutputHashingCompat;
189 /**
190 * If true, build process will extracts css specified in styles entry as styles.css.
191 */
192 extractCss?: boolean;
193 /**
194 * Custom environment variables to be included in bundle.
195 */
196 environmentVariables?: boolean | {
197 [key: string]: boolean | string;
198 };
199 /**
200 * Performance options.
201 */
202 performance?: PerformanceOptions;
203 /**
204 * List of additional NgModule files that will be lazy loaded (lazy router modules will be discovered automatically).
205 */
206 lazyModules?: string[];
207 /**
208 * Use file name for lazy loaded chunks.
209 */
210 namedChunks?: boolean;
211 /**
212 * This option controls if and how source maps are generated.
213 */
214 sourceMapDevTool?: 'eval' | 'inline-source-map' | 'cheap-eval-source-map' | 'cheap-source-map' | 'cheap-module-eval-source-map' | 'cheap-module-source-map' | 'eval-source-map' | 'source-map' | 'nosources-source-map' | 'hidden-source-map' | 'nosources-source-map' | '@eval' | '@inline-source-map' | '@cheap-eval-source-map' | '@cheap-source-map' | '@cheap-module-eval-source-map' | '@cheap-module-source-map' | '@eval-source-map' | '@source-map' | '@nosources-source-map' | '@hidden-source-map' | '@nosources-source-map' | '#eval' | '#inline-source-map' | '#cheap-eval-source-map' | '#cheap-source-map' | '#cheap-module-eval-source-map' | '#cheap-module-source-map' | '#eval-source-map' | '#source-map' | '#nosources-source-map' | '#hidden-source-map' | '#nosources-source-map' | '#@eval' | '#@inline-source-map' | '#@cheap-eval-source-map' | '#@cheap-source-map' | '#@cheap-module-eval-source-map' | '#@cheap-module-source-map' | '#@eval-source-map' | '#@source-map' | '#@nosources-source-map' | '#@hidden-source-map' | '#@nosources-source-map' | boolean;
215 /**
216 * Customize the names used in each source map.
217 */
218 sourceMapDevToolModuleFilenameTemplate?: '[absolute-resource-path]' | '[resource]' | '[resource-path]' | string;
219 /**
220 * A fallback used when the template string of 'sourceMapFilenameTemplate' yields duplicates.
221 */
222 sourceMapDevToolFallbackModuleFilenameTemplate?: '[absolute-resource-path]' | '[resource]' | '[resource-path]' | string;
223 /**
224 * Custom webpack config file to be merged.
225 */
226 webpackConfig?: string;
227 /**
228 * Replaces resources with new resources.
229 */
230 fileReplacements?: FileReplacementEntry[];
231 /**
232 * Webpack Bundle analyzer options.
233 */
234 bundleAnalyzer?: BundleAnalyzerOptions | boolean;
235 /**
236 * The webpack stats option - lets you precisely control what bundle information gets displayed.
237 */
238 stats?: WebpackStatsPreset | WebpackStatsToStringOptions;
239 /**
240 * The externals configuration option provides a way of excluding dependencies from the output bundle.
241 */
242 externals?: ExternalsEntry | ExternalsEntry[];
243 /**
244 * Custom Node.js resolution main fields.
245 */
246 nodeResolveFields?: string[];
247 /**
248 * Path to the translation file.
249 */
250 i18nFile?: string;
251 /**
252 * Import format if different from `i18nFormat`.
253 */
254 i18nFormat?: string;
255 /**
256 * Locale of the imported translations.
257 */
258 i18nLocale?: string;
259 /**
260 * How to handle missing messages.
261 */
262 i18nMissingTranslation?: 'error' | 'warning' | 'ignore';
263 /**
264 * Path to the extracted message file.
265 */
266 i18nOutFile?: string;
267 /**
268 * Export format (xlf, xlf2 or xmb).
269 */
270 i18nOutFormat?: string;
271 /**
272 * Defines the optimization level of the build.
273 */
274 optimization?: boolean;
275 /**
276 * Set true to enable build optimizer.
277 */
278 buildOptimizer?: boolean;
279 /**
280 * Run the TypeScript type checker in a forked process.
281 */
282 forkTypeChecker?: boolean;
283 /**
284 * Set true to enable scope hoisting.
285 */
286 concatenateModules?: boolean;
287 /**
288 * If true, node_modules packages are not included in bundle.
289 */
290 nodeModulesAsExternals?: boolean;
291 /**
292 * Extract all licenses in a separate file.
293 */
294 extractLicenses?: boolean;
295 /**
296 * Output file name for extracted licenses.
297 */
298 extractLicenseOutputFilename?: string;
299 /**
300 * Generates a service worker config for production builds.
301 */
302 serviceWorker?: boolean;
303 /**
304 * Path to ngsw-config.json.
305 */
306 ngswConfigPath?: string;
307}
308export interface AppEnvOverridesOptions {
309 [name: string]: AppProjectConfigBase;
310}
311/**
312 * @additionalProperties false
313 */
314export interface AppProjectConfig extends AppProjectConfigBase, ProjectConfig<AppProjectConfigBase> {
315 /**
316 * To override properties based on build environment.
317 */
318 envOverrides?: AppEnvOverridesOptions;
319}