[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | import { logging } from '@angular-devkit/core';
|
---|
| 9 | import { ParsedConfiguration } from '@angular/compiler-cli';
|
---|
| 10 | import { AssetPatternClass, Budget, CrossOrigin, ExtraEntryPoint, I18NMissingTranslation, IndexUnion, InlineStyleLanguage, Localize, SourceMapClass } from '../browser/schema';
|
---|
| 11 | import { Schema as DevServerSchema } from '../dev-server/schema';
|
---|
| 12 | import { NormalizedFileReplacement } from './normalize-file-replacements';
|
---|
| 13 | import { NormalizedOptimizationOptions } from './normalize-optimization';
|
---|
| 14 | export interface BuildOptions {
|
---|
| 15 | optimization: NormalizedOptimizationOptions;
|
---|
| 16 | environment?: string;
|
---|
| 17 | outputPath: string;
|
---|
| 18 | resourcesOutputPath?: string;
|
---|
| 19 | aot?: boolean;
|
---|
| 20 | sourceMap: SourceMapClass;
|
---|
| 21 | vendorChunk?: boolean;
|
---|
| 22 | commonChunk?: boolean;
|
---|
| 23 | baseHref?: string;
|
---|
| 24 | deployUrl?: string;
|
---|
| 25 | verbose?: boolean;
|
---|
| 26 | progress?: boolean;
|
---|
| 27 | localize?: Localize;
|
---|
| 28 | i18nMissingTranslation?: I18NMissingTranslation;
|
---|
| 29 | /** @deprecated since version 11.0. No longer required to disable CSS extraction for HMR.*/
|
---|
| 30 | extractCss?: boolean;
|
---|
| 31 | bundleDependencies?: boolean;
|
---|
| 32 | externalDependencies?: string[];
|
---|
| 33 | watch?: boolean;
|
---|
| 34 | outputHashing?: string;
|
---|
| 35 | poll?: number;
|
---|
| 36 | index?: IndexUnion;
|
---|
| 37 | deleteOutputPath?: boolean;
|
---|
| 38 | preserveSymlinks?: boolean;
|
---|
| 39 | extractLicenses?: boolean;
|
---|
| 40 | showCircularDependencies?: boolean;
|
---|
| 41 | buildOptimizer?: boolean;
|
---|
| 42 | namedChunks?: boolean;
|
---|
| 43 | crossOrigin?: CrossOrigin;
|
---|
| 44 | subresourceIntegrity?: boolean;
|
---|
| 45 | serviceWorker?: boolean;
|
---|
| 46 | webWorkerTsConfig?: string;
|
---|
| 47 | statsJson: boolean;
|
---|
| 48 | hmr?: boolean;
|
---|
| 49 | main: string;
|
---|
| 50 | polyfills?: string;
|
---|
| 51 | budgets: Budget[];
|
---|
| 52 | assets: AssetPatternClass[];
|
---|
| 53 | scripts: ExtraEntryPoint[];
|
---|
| 54 | styles: ExtraEntryPoint[];
|
---|
| 55 | stylePreprocessorOptions?: {
|
---|
| 56 | includePaths: string[];
|
---|
| 57 | };
|
---|
| 58 | platform?: 'browser' | 'server';
|
---|
| 59 | fileReplacements: NormalizedFileReplacement[];
|
---|
| 60 | inlineStyleLanguage?: InlineStyleLanguage;
|
---|
| 61 | allowedCommonJsDependencies?: string[];
|
---|
| 62 | differentialLoadingNeeded?: boolean;
|
---|
| 63 | }
|
---|
| 64 | export interface WebpackTestOptions extends BuildOptions {
|
---|
| 65 | codeCoverage?: boolean;
|
---|
| 66 | codeCoverageExclude?: string[];
|
---|
| 67 | }
|
---|
| 68 | export interface WebpackDevServerOptions extends BuildOptions, Omit<DevServerSchema, 'optimization' | 'sourceMap' | 'browserTarget'> {
|
---|
| 69 | }
|
---|
| 70 | export interface WebpackConfigOptions<T = BuildOptions> {
|
---|
| 71 | root: string;
|
---|
| 72 | logger: logging.Logger;
|
---|
| 73 | projectRoot: string;
|
---|
| 74 | sourceRoot?: string;
|
---|
| 75 | buildOptions: T;
|
---|
| 76 | tsConfig: ParsedConfiguration;
|
---|
| 77 | tsConfigPath: string;
|
---|
| 78 | scriptTarget: import('typescript').ScriptTarget;
|
---|
| 79 | }
|
---|