@angular-devkit/build-angular 14.1.0-next.1 → 14.1.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/builders.json CHANGED
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "browser-esbuild": {
15
15
  "implementation": "./src/builders/browser-esbuild",
16
- "schema": "./src/builders/browser/schema.json",
16
+ "schema": "./src/builders/browser-esbuild/schema.json",
17
17
  "description": "Build a browser application."
18
18
  },
19
19
  "dev-server": {
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "14.1.0-next.1",
3
+ "version": "14.1.0-next.2",
4
4
  "description": "Angular Webpack Build Facade",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
7
7
  "builders": "builders.json",
8
8
  "dependencies": {
9
9
  "@ampproject/remapping": "2.2.0",
10
- "@angular-devkit/architect": "0.1401.0-next.1",
11
- "@angular-devkit/build-webpack": "0.1401.0-next.1",
12
- "@angular-devkit/core": "14.1.0-next.1",
10
+ "@angular-devkit/architect": "0.1401.0-next.2",
11
+ "@angular-devkit/build-webpack": "0.1401.0-next.2",
12
+ "@angular-devkit/core": "14.1.0-next.2",
13
13
  "@babel/core": "7.18.2",
14
14
  "@babel/generator": "7.18.2",
15
15
  "@babel/helper-annotate-as-pure": "7.16.7",
@@ -20,7 +20,7 @@
20
20
  "@babel/runtime": "7.18.3",
21
21
  "@babel/template": "7.16.7",
22
22
  "@discoveryjs/json-ext": "0.5.7",
23
- "@ngtools/webpack": "14.1.0-next.1",
23
+ "@ngtools/webpack": "14.1.0-next.2",
24
24
  "ansi-colors": "4.1.3",
25
25
  "babel-loader": "8.2.5",
26
26
  "babel-plugin-istanbul": "6.1.1",
@@ -52,7 +52,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
52
52
  });
53
53
  return {
54
54
  async customOptions(options, { source, map }) {
55
- var _a, _b;
55
+ var _a, _b, _c;
56
56
  const { i18n, scriptTarget, aot, optimize, instrumentCode, supportedBrowsers, ...rawOptions } = options;
57
57
  // Must process file if plugins are added
58
58
  let shouldProcess = Array.isArray(rawOptions.plugins) && rawOptions.plugins.length > 0;
@@ -89,7 +89,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
89
89
  // Comparable behavior to tsconfig target of ES5
90
90
  customOptions.supportedBrowsers = ['IE 9'];
91
91
  }
92
- else if (isJsFile) {
92
+ else if (isJsFile && ((_a = customOptions.supportedBrowsers) === null || _a === void 0 ? void 0 : _a.length)) {
93
93
  // Applications code ES version can be controlled using TypeScript's `target` option.
94
94
  // However, this doesn't effect libraries and hence we use preset-env to downlevel ES fetaures
95
95
  // based on the supported browsers in browserlist.
@@ -142,7 +142,7 @@ exports.default = (0, babel_loader_1.custom)(() => {
142
142
  pureTopLevel: angularPackage,
143
143
  // JavaScript modules that are marked as side effect free are considered to have
144
144
  // no decorators that contain non-local effects.
145
- wrapDecorators: !!((_b = (_a = this._module) === null || _a === void 0 ? void 0 : _a.factoryMeta) === null || _b === void 0 ? void 0 : _b.sideEffectFree),
145
+ wrapDecorators: !!((_c = (_b = this._module) === null || _b === void 0 ? void 0 : _b.factoryMeta) === null || _c === void 0 ? void 0 : _c.sideEffectFree),
146
146
  };
147
147
  shouldProcess = true;
148
148
  }
@@ -6,7 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
9
- import { Schema as BrowserBuilderOptions } from '../browser/schema';
9
+ import { Schema as BrowserBuilderOptions } from './schema';
10
10
  /**
11
11
  * Main execution function for the esbuild-based application builder.
12
12
  * The options are compatible with the Webpack-based builder.
@@ -14,6 +14,6 @@ import { Schema as BrowserBuilderOptions } from '../browser/schema';
14
14
  * @param context The Architect builder context object
15
15
  * @returns A promise with the builder result output
16
16
  */
17
- export declare function execute(options: BrowserBuilderOptions, context: BuilderContext): Promise<BuilderOutput>;
17
+ export declare function buildEsbuildBrowser(options: BrowserBuilderOptions, context: BuilderContext): Promise<BuilderOutput>;
18
18
  declare const _default: import("@angular-devkit/architect/src/internal").Builder<BrowserBuilderOptions & import("../../../../core/src").JsonObject>;
19
19
  export default _default;
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
30
30
  return result;
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.execute = void 0;
33
+ exports.buildEsbuildBrowser = void 0;
34
34
  const architect_1 = require("@angular-devkit/architect");
35
35
  const assert = __importStar(require("assert"));
36
36
  const fs_1 = require("fs");
@@ -56,7 +56,7 @@ const stylesheets_1 = require("./stylesheets");
56
56
  * @returns A promise with the builder result output
57
57
  */
58
58
  // eslint-disable-next-line max-lines-per-function
59
- async function execute(options, context) {
59
+ async function buildEsbuildBrowser(options, context) {
60
60
  var _a, _b, _c, _d, _e, _f;
61
61
  const startTime = Date.now();
62
62
  // Only AOT is currently supported
@@ -217,7 +217,7 @@ async function execute(options, context) {
217
217
  context.logger.info(`Complete. [${(Date.now() - startTime) / 1000} seconds]`);
218
218
  return { success: true };
219
219
  }
220
- exports.execute = execute;
220
+ exports.buildEsbuildBrowser = buildEsbuildBrowser;
221
221
  function createOutputFileFromText(path, text) {
222
222
  return {
223
223
  path,
@@ -247,6 +247,7 @@ async function bundleCode(workspaceRoot, entryPoints, outputNames, options, opti
247
247
  sourcemap: sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true),
248
248
  splitting: true,
249
249
  tsconfig,
250
+ external: options.externalDependencies,
250
251
  write: false,
251
252
  platform: 'browser',
252
253
  preserveSymlinks: options.preserveSymlinks,
@@ -272,4 +273,4 @@ async function bundleCode(workspaceRoot, entryPoints, outputNames, options, opti
272
273
  },
273
274
  });
274
275
  }
275
- exports.default = (0, architect_1.createBuilder)(execute);
276
+ exports.default = (0, architect_1.createBuilder)(buildEsbuildBrowser);
@@ -0,0 +1,428 @@
1
+ /**
2
+ * Browser target options
3
+ */
4
+ export 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
+ * Exclude the listed external dependencies from being bundled into the bundle. Instead, the
50
+ * created bundle relies on these dependencies to be available during runtime.
51
+ */
52
+ externalDependencies?: string[];
53
+ /**
54
+ * Extract all licenses in a separate file.
55
+ */
56
+ extractLicenses?: boolean;
57
+ /**
58
+ * Replace compilation source files with other compilation source files in the build.
59
+ */
60
+ fileReplacements?: FileReplacement[];
61
+ /**
62
+ * How to handle duplicate translations for i18n.
63
+ */
64
+ i18nDuplicateTranslation?: I18NTranslation;
65
+ /**
66
+ * How to handle missing translations for i18n.
67
+ */
68
+ i18nMissingTranslation?: I18NTranslation;
69
+ /**
70
+ * Configures the generation of the application's HTML index.
71
+ */
72
+ index: IndexUnion;
73
+ /**
74
+ * The stylesheet language to use for the application's inline component styles.
75
+ */
76
+ inlineStyleLanguage?: InlineStyleLanguage;
77
+ /**
78
+ * Translate the bundles in one or more locales.
79
+ */
80
+ localize?: Localize;
81
+ /**
82
+ * The full path for the main entry point to the app, relative to the current workspace.
83
+ */
84
+ main: string;
85
+ /**
86
+ * Use file name for lazy loaded chunks.
87
+ */
88
+ namedChunks?: boolean;
89
+ /**
90
+ * Path to ngsw-config.json.
91
+ */
92
+ ngswConfigPath?: string;
93
+ /**
94
+ * Enables optimization of the build output. Including minification of scripts and styles,
95
+ * tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For
96
+ * more information, see
97
+ * https://angular.io/guide/workspace-config#optimization-configuration.
98
+ */
99
+ optimization?: OptimizationUnion;
100
+ /**
101
+ * Define the output filename cache-busting hashing mode.
102
+ */
103
+ outputHashing?: OutputHashing;
104
+ /**
105
+ * The full path for the new output directory, relative to the current workspace.
106
+ * By default, writes output to a folder named dist/ in the current project.
107
+ */
108
+ outputPath: string;
109
+ /**
110
+ * Enable and define the file watching poll time period in milliseconds.
111
+ */
112
+ poll?: number;
113
+ /**
114
+ * The full path for the polyfills file, relative to the current workspace.
115
+ */
116
+ polyfills?: string;
117
+ /**
118
+ * Do not use the real path when resolving modules. If unset then will default to `true` if
119
+ * NodeJS option --preserve-symlinks is set.
120
+ */
121
+ preserveSymlinks?: boolean;
122
+ /**
123
+ * Log progress to the console while building.
124
+ */
125
+ progress?: boolean;
126
+ /**
127
+ * The path where style resources will be placed, relative to outputPath.
128
+ */
129
+ resourcesOutputPath?: string;
130
+ /**
131
+ * Global scripts to be included in the build.
132
+ */
133
+ scripts?: ScriptElement[];
134
+ /**
135
+ * Generates a service worker config for production builds.
136
+ */
137
+ serviceWorker?: boolean;
138
+ /**
139
+ * Output source maps for scripts and styles. For more information, see
140
+ * https://angular.io/guide/workspace-config#source-map-configuration.
141
+ */
142
+ sourceMap?: SourceMapUnion;
143
+ /**
144
+ * Generates a 'stats.json' file which can be analyzed using tools such as
145
+ * 'webpack-bundle-analyzer'.
146
+ */
147
+ statsJson?: boolean;
148
+ /**
149
+ * Options to pass to style preprocessors.
150
+ */
151
+ stylePreprocessorOptions?: StylePreprocessorOptions;
152
+ /**
153
+ * Global styles to be included in the build.
154
+ */
155
+ styles?: StyleElement[];
156
+ /**
157
+ * Enables the use of subresource integrity validation.
158
+ */
159
+ subresourceIntegrity?: boolean;
160
+ /**
161
+ * The full path for the TypeScript configuration file, relative to the current workspace.
162
+ */
163
+ tsConfig: string;
164
+ /**
165
+ * Generate a seperate bundle containing only vendor libraries. This option should only used
166
+ * for development.
167
+ */
168
+ vendorChunk?: boolean;
169
+ /**
170
+ * Adds more details to output logging.
171
+ */
172
+ verbose?: boolean;
173
+ /**
174
+ * Run build when files change.
175
+ */
176
+ watch?: boolean;
177
+ /**
178
+ * TypeScript configuration for Web Worker modules.
179
+ */
180
+ webWorkerTsConfig?: string;
181
+ }
182
+ export declare type AssetPattern = AssetPatternClass | string;
183
+ export interface AssetPatternClass {
184
+ /**
185
+ * Allow glob patterns to follow symlink directories. This allows subdirectories of the
186
+ * symlink to be searched.
187
+ */
188
+ followSymlinks?: boolean;
189
+ /**
190
+ * The pattern to match.
191
+ */
192
+ glob: string;
193
+ /**
194
+ * An array of globs to ignore.
195
+ */
196
+ ignore?: string[];
197
+ /**
198
+ * The input directory path in which to apply 'glob'. Defaults to the project root.
199
+ */
200
+ input: string;
201
+ /**
202
+ * Absolute path within the output.
203
+ */
204
+ output: string;
205
+ }
206
+ export interface Budget {
207
+ /**
208
+ * The baseline size for comparison.
209
+ */
210
+ baseline?: string;
211
+ /**
212
+ * The threshold for error relative to the baseline (min & max).
213
+ */
214
+ error?: string;
215
+ /**
216
+ * The maximum threshold for error relative to the baseline.
217
+ */
218
+ maximumError?: string;
219
+ /**
220
+ * The maximum threshold for warning relative to the baseline.
221
+ */
222
+ maximumWarning?: string;
223
+ /**
224
+ * The minimum threshold for error relative to the baseline.
225
+ */
226
+ minimumError?: string;
227
+ /**
228
+ * The minimum threshold for warning relative to the baseline.
229
+ */
230
+ minimumWarning?: string;
231
+ /**
232
+ * The name of the bundle.
233
+ */
234
+ name?: string;
235
+ /**
236
+ * The type of budget.
237
+ */
238
+ type: Type;
239
+ /**
240
+ * The threshold for warning relative to the baseline (min & max).
241
+ */
242
+ warning?: string;
243
+ }
244
+ /**
245
+ * The type of budget.
246
+ */
247
+ export declare enum Type {
248
+ All = "all",
249
+ AllScript = "allScript",
250
+ Any = "any",
251
+ AnyComponentStyle = "anyComponentStyle",
252
+ AnyScript = "anyScript",
253
+ Bundle = "bundle",
254
+ Initial = "initial"
255
+ }
256
+ /**
257
+ * Define the crossorigin attribute setting of elements that provide CORS support.
258
+ */
259
+ export declare enum CrossOrigin {
260
+ Anonymous = "anonymous",
261
+ None = "none",
262
+ UseCredentials = "use-credentials"
263
+ }
264
+ export interface FileReplacement {
265
+ replace?: string;
266
+ replaceWith?: string;
267
+ src?: string;
268
+ with?: string;
269
+ }
270
+ /**
271
+ * How to handle duplicate translations for i18n.
272
+ *
273
+ * How to handle missing translations for i18n.
274
+ */
275
+ export declare enum I18NTranslation {
276
+ Error = "error",
277
+ Ignore = "ignore",
278
+ Warning = "warning"
279
+ }
280
+ /**
281
+ * Configures the generation of the application's HTML index.
282
+ */
283
+ export declare type IndexUnion = IndexObject | string;
284
+ export interface IndexObject {
285
+ /**
286
+ * The path of a file to use for the application's generated HTML index.
287
+ */
288
+ input: string;
289
+ /**
290
+ * The output path of the application's generated HTML index file. The full provided path
291
+ * will be used and will be considered relative to the application's configured output path.
292
+ */
293
+ output?: string;
294
+ }
295
+ /**
296
+ * The stylesheet language to use for the application's inline component styles.
297
+ */
298
+ export declare enum InlineStyleLanguage {
299
+ Css = "css",
300
+ Less = "less",
301
+ Sass = "sass",
302
+ Scss = "scss"
303
+ }
304
+ /**
305
+ * Translate the bundles in one or more locales.
306
+ */
307
+ export declare type Localize = string[] | boolean;
308
+ /**
309
+ * Enables optimization of the build output. Including minification of scripts and styles,
310
+ * tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For
311
+ * more information, see
312
+ * https://angular.io/guide/workspace-config#optimization-configuration.
313
+ */
314
+ export declare type OptimizationUnion = boolean | OptimizationClass;
315
+ export interface OptimizationClass {
316
+ /**
317
+ * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY`
318
+ * environment variable can be used to specify a proxy server.
319
+ */
320
+ fonts?: FontsUnion;
321
+ /**
322
+ * Enables optimization of the scripts output.
323
+ */
324
+ scripts?: boolean;
325
+ /**
326
+ * Enables optimization of the styles output.
327
+ */
328
+ styles?: StylesUnion;
329
+ }
330
+ /**
331
+ * Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY`
332
+ * environment variable can be used to specify a proxy server.
333
+ */
334
+ export declare type FontsUnion = boolean | FontsClass;
335
+ export interface FontsClass {
336
+ /**
337
+ * Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS
338
+ * definitions in the application's HTML index file. This option requires internet access.
339
+ * `HTTPS_PROXY` environment variable can be used to specify a proxy server.
340
+ */
341
+ inline?: boolean;
342
+ }
343
+ /**
344
+ * Enables optimization of the styles output.
345
+ */
346
+ export declare type StylesUnion = boolean | StylesClass;
347
+ export interface StylesClass {
348
+ /**
349
+ * Extract and inline critical CSS definitions to improve first paint time.
350
+ */
351
+ inlineCritical?: boolean;
352
+ /**
353
+ * Minify CSS definitions by removing extraneous whitespace and comments, merging
354
+ * identifiers and minimizing values.
355
+ */
356
+ minify?: boolean;
357
+ }
358
+ /**
359
+ * Define the output filename cache-busting hashing mode.
360
+ */
361
+ export declare enum OutputHashing {
362
+ All = "all",
363
+ Bundles = "bundles",
364
+ Media = "media",
365
+ None = "none"
366
+ }
367
+ export declare type ScriptElement = ScriptClass | string;
368
+ export interface ScriptClass {
369
+ /**
370
+ * The bundle name for this extra entry point.
371
+ */
372
+ bundleName?: string;
373
+ /**
374
+ * If the bundle will be referenced in the HTML file.
375
+ */
376
+ inject?: boolean;
377
+ /**
378
+ * The file to include.
379
+ */
380
+ input: string;
381
+ }
382
+ /**
383
+ * Output source maps for scripts and styles. For more information, see
384
+ * https://angular.io/guide/workspace-config#source-map-configuration.
385
+ */
386
+ export declare type SourceMapUnion = boolean | SourceMapClass;
387
+ export interface SourceMapClass {
388
+ /**
389
+ * Output source maps used for error reporting tools.
390
+ */
391
+ hidden?: boolean;
392
+ /**
393
+ * Output source maps for all scripts.
394
+ */
395
+ scripts?: boolean;
396
+ /**
397
+ * Output source maps for all styles.
398
+ */
399
+ styles?: boolean;
400
+ /**
401
+ * Resolve vendor packages source maps.
402
+ */
403
+ vendor?: boolean;
404
+ }
405
+ /**
406
+ * Options to pass to style preprocessors.
407
+ */
408
+ export interface StylePreprocessorOptions {
409
+ /**
410
+ * Paths to include. Paths will be resolved to workspace root.
411
+ */
412
+ includePaths?: string[];
413
+ }
414
+ export declare type StyleElement = StyleClass | string;
415
+ export interface StyleClass {
416
+ /**
417
+ * The bundle name for this extra entry point.
418
+ */
419
+ bundleName?: string;
420
+ /**
421
+ * If the bundle will be referenced in the HTML file.
422
+ */
423
+ inject?: boolean;
424
+ /**
425
+ * The file to include.
426
+ */
427
+ input: string;
428
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ // THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
3
+ // CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.OutputHashing = exports.InlineStyleLanguage = exports.I18NTranslation = exports.CrossOrigin = exports.Type = void 0;
6
+ /**
7
+ * The type of budget.
8
+ */
9
+ var Type;
10
+ (function (Type) {
11
+ Type["All"] = "all";
12
+ Type["AllScript"] = "allScript";
13
+ Type["Any"] = "any";
14
+ Type["AnyComponentStyle"] = "anyComponentStyle";
15
+ Type["AnyScript"] = "anyScript";
16
+ Type["Bundle"] = "bundle";
17
+ Type["Initial"] = "initial";
18
+ })(Type = exports.Type || (exports.Type = {}));
19
+ /**
20
+ * Define the crossorigin attribute setting of elements that provide CORS support.
21
+ */
22
+ var CrossOrigin;
23
+ (function (CrossOrigin) {
24
+ CrossOrigin["Anonymous"] = "anonymous";
25
+ CrossOrigin["None"] = "none";
26
+ CrossOrigin["UseCredentials"] = "use-credentials";
27
+ })(CrossOrigin = exports.CrossOrigin || (exports.CrossOrigin = {}));
28
+ /**
29
+ * How to handle duplicate translations for i18n.
30
+ *
31
+ * How to handle missing translations for i18n.
32
+ */
33
+ var I18NTranslation;
34
+ (function (I18NTranslation) {
35
+ I18NTranslation["Error"] = "error";
36
+ I18NTranslation["Ignore"] = "ignore";
37
+ I18NTranslation["Warning"] = "warning";
38
+ })(I18NTranslation = exports.I18NTranslation || (exports.I18NTranslation = {}));
39
+ /**
40
+ * The stylesheet language to use for the application's inline component styles.
41
+ */
42
+ var InlineStyleLanguage;
43
+ (function (InlineStyleLanguage) {
44
+ InlineStyleLanguage["Css"] = "css";
45
+ InlineStyleLanguage["Less"] = "less";
46
+ InlineStyleLanguage["Sass"] = "sass";
47
+ InlineStyleLanguage["Scss"] = "scss";
48
+ })(InlineStyleLanguage = exports.InlineStyleLanguage || (exports.InlineStyleLanguage = {}));
49
+ /**
50
+ * Define the output filename cache-busting hashing mode.
51
+ */
52
+ var OutputHashing;
53
+ (function (OutputHashing) {
54
+ OutputHashing["All"] = "all";
55
+ OutputHashing["Bundles"] = "bundles";
56
+ OutputHashing["Media"] = "media";
57
+ OutputHashing["None"] = "none";
58
+ })(OutputHashing = exports.OutputHashing || (exports.OutputHashing = {}));
@@ -0,0 +1,542 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "title": "Esbuild browser schema for Build Facade.",
4
+ "description": "Browser target options",
5
+ "type": "object",
6
+ "properties": {
7
+ "assets": {
8
+ "type": "array",
9
+ "description": "List of static application assets.",
10
+ "default": [],
11
+ "items": {
12
+ "$ref": "#/definitions/assetPattern"
13
+ }
14
+ },
15
+ "main": {
16
+ "type": "string",
17
+ "description": "The full path for the main entry point to the app, relative to the current workspace."
18
+ },
19
+ "polyfills": {
20
+ "type": "string",
21
+ "description": "The full path for the polyfills file, relative to the current workspace."
22
+ },
23
+ "tsConfig": {
24
+ "type": "string",
25
+ "description": "The full path for the TypeScript configuration file, relative to the current workspace."
26
+ },
27
+ "scripts": {
28
+ "description": "Global scripts to be included in the build.",
29
+ "type": "array",
30
+ "default": [],
31
+ "items": {
32
+ "oneOf": [
33
+ {
34
+ "type": "object",
35
+ "properties": {
36
+ "input": {
37
+ "type": "string",
38
+ "description": "The file to include.",
39
+ "pattern": "\\.[cm]?jsx?$"
40
+ },
41
+ "bundleName": {
42
+ "type": "string",
43
+ "pattern": "^[\\w\\-.]*$",
44
+ "description": "The bundle name for this extra entry point."
45
+ },
46
+ "inject": {
47
+ "type": "boolean",
48
+ "description": "If the bundle will be referenced in the HTML file.",
49
+ "default": true
50
+ }
51
+ },
52
+ "additionalProperties": false,
53
+ "required": ["input"]
54
+ },
55
+ {
56
+ "type": "string",
57
+ "description": "The file to include.",
58
+ "pattern": "\\.[cm]?jsx?$"
59
+ }
60
+ ]
61
+ }
62
+ },
63
+ "styles": {
64
+ "description": "Global styles to be included in the build.",
65
+ "type": "array",
66
+ "default": [],
67
+ "items": {
68
+ "oneOf": [
69
+ {
70
+ "type": "object",
71
+ "properties": {
72
+ "input": {
73
+ "type": "string",
74
+ "description": "The file to include.",
75
+ "pattern": "\\.(?:css|scss|sass|less|styl)$"
76
+ },
77
+ "bundleName": {
78
+ "type": "string",
79
+ "pattern": "^[\\w\\-.]*$",
80
+ "description": "The bundle name for this extra entry point."
81
+ },
82
+ "inject": {
83
+ "type": "boolean",
84
+ "description": "If the bundle will be referenced in the HTML file.",
85
+ "default": true
86
+ }
87
+ },
88
+ "additionalProperties": false,
89
+ "required": ["input"]
90
+ },
91
+ {
92
+ "type": "string",
93
+ "description": "The file to include.",
94
+ "pattern": "\\.(?:css|scss|sass|less|styl)$"
95
+ }
96
+ ]
97
+ }
98
+ },
99
+ "inlineStyleLanguage": {
100
+ "description": "The stylesheet language to use for the application's inline component styles.",
101
+ "type": "string",
102
+ "default": "css",
103
+ "enum": ["css", "less", "sass", "scss"]
104
+ },
105
+ "stylePreprocessorOptions": {
106
+ "description": "Options to pass to style preprocessors.",
107
+ "type": "object",
108
+ "properties": {
109
+ "includePaths": {
110
+ "description": "Paths to include. Paths will be resolved to workspace root.",
111
+ "type": "array",
112
+ "items": {
113
+ "type": "string"
114
+ },
115
+ "default": []
116
+ }
117
+ },
118
+ "additionalProperties": false
119
+ },
120
+ "externalDependencies": {
121
+ "description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
122
+ "type": "array",
123
+ "items": {
124
+ "type": "string"
125
+ },
126
+ "default": []
127
+ },
128
+ "optimization": {
129
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
130
+ "x-user-analytics": 16,
131
+ "default": true,
132
+ "oneOf": [
133
+ {
134
+ "type": "object",
135
+ "properties": {
136
+ "scripts": {
137
+ "type": "boolean",
138
+ "description": "Enables optimization of the scripts output.",
139
+ "default": true
140
+ },
141
+ "styles": {
142
+ "description": "Enables optimization of the styles output.",
143
+ "default": true,
144
+ "oneOf": [
145
+ {
146
+ "type": "object",
147
+ "properties": {
148
+ "minify": {
149
+ "type": "boolean",
150
+ "description": "Minify CSS definitions by removing extraneous whitespace and comments, merging identifiers and minimizing values.",
151
+ "default": true
152
+ },
153
+ "inlineCritical": {
154
+ "type": "boolean",
155
+ "description": "Extract and inline critical CSS definitions to improve first paint time.",
156
+ "default": true
157
+ }
158
+ },
159
+ "additionalProperties": false
160
+ },
161
+ {
162
+ "type": "boolean"
163
+ }
164
+ ]
165
+ },
166
+ "fonts": {
167
+ "description": "Enables optimization for fonts. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
168
+ "default": true,
169
+ "oneOf": [
170
+ {
171
+ "type": "object",
172
+ "properties": {
173
+ "inline": {
174
+ "type": "boolean",
175
+ "description": "Reduce render blocking requests by inlining external Google Fonts and Adobe Fonts CSS definitions in the application's HTML index file. This option requires internet access. `HTTPS_PROXY` environment variable can be used to specify a proxy server.",
176
+ "default": true
177
+ }
178
+ },
179
+ "additionalProperties": false
180
+ },
181
+ {
182
+ "type": "boolean"
183
+ }
184
+ ]
185
+ }
186
+ },
187
+ "additionalProperties": false
188
+ },
189
+ {
190
+ "type": "boolean"
191
+ }
192
+ ]
193
+ },
194
+ "fileReplacements": {
195
+ "description": "Replace compilation source files with other compilation source files in the build.",
196
+ "type": "array",
197
+ "items": {
198
+ "$ref": "#/definitions/fileReplacement"
199
+ },
200
+ "default": []
201
+ },
202
+ "outputPath": {
203
+ "type": "string",
204
+ "description": "The full path for the new output directory, relative to the current workspace.\nBy default, writes output to a folder named dist/ in the current project."
205
+ },
206
+ "resourcesOutputPath": {
207
+ "type": "string",
208
+ "description": "The path where style resources will be placed, relative to outputPath."
209
+ },
210
+ "aot": {
211
+ "type": "boolean",
212
+ "description": "Build using Ahead of Time compilation.",
213
+ "x-user-analytics": 13,
214
+ "default": true
215
+ },
216
+ "sourceMap": {
217
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
218
+ "default": false,
219
+ "oneOf": [
220
+ {
221
+ "type": "object",
222
+ "properties": {
223
+ "scripts": {
224
+ "type": "boolean",
225
+ "description": "Output source maps for all scripts.",
226
+ "default": true
227
+ },
228
+ "styles": {
229
+ "type": "boolean",
230
+ "description": "Output source maps for all styles.",
231
+ "default": true
232
+ },
233
+ "hidden": {
234
+ "type": "boolean",
235
+ "description": "Output source maps used for error reporting tools.",
236
+ "default": false
237
+ },
238
+ "vendor": {
239
+ "type": "boolean",
240
+ "description": "Resolve vendor packages source maps.",
241
+ "default": false
242
+ }
243
+ },
244
+ "additionalProperties": false
245
+ },
246
+ {
247
+ "type": "boolean"
248
+ }
249
+ ]
250
+ },
251
+ "vendorChunk": {
252
+ "type": "boolean",
253
+ "description": "Generate a seperate bundle containing only vendor libraries. This option should only used for development.",
254
+ "default": false
255
+ },
256
+ "commonChunk": {
257
+ "type": "boolean",
258
+ "description": "Generate a seperate bundle containing code used across multiple bundles.",
259
+ "default": true
260
+ },
261
+ "baseHref": {
262
+ "type": "string",
263
+ "description": "Base url for the application being built."
264
+ },
265
+ "deployUrl": {
266
+ "type": "string",
267
+ "description": "URL where files will be deployed.",
268
+ "x-deprecated": "Use \"baseHref\" option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
269
+ },
270
+ "verbose": {
271
+ "type": "boolean",
272
+ "description": "Adds more details to output logging.",
273
+ "default": false
274
+ },
275
+ "progress": {
276
+ "type": "boolean",
277
+ "description": "Log progress to the console while building.",
278
+ "default": true
279
+ },
280
+ "i18nMissingTranslation": {
281
+ "type": "string",
282
+ "description": "How to handle missing translations for i18n.",
283
+ "enum": ["warning", "error", "ignore"],
284
+ "default": "warning"
285
+ },
286
+ "i18nDuplicateTranslation": {
287
+ "type": "string",
288
+ "description": "How to handle duplicate translations for i18n.",
289
+ "enum": ["warning", "error", "ignore"],
290
+ "default": "warning"
291
+ },
292
+ "localize": {
293
+ "description": "Translate the bundles in one or more locales.",
294
+ "oneOf": [
295
+ {
296
+ "type": "boolean",
297
+ "description": "Translate all locales."
298
+ },
299
+ {
300
+ "type": "array",
301
+ "description": "List of locales ID's to translate.",
302
+ "minItems": 1,
303
+ "items": {
304
+ "type": "string",
305
+ "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
306
+ }
307
+ }
308
+ ]
309
+ },
310
+ "watch": {
311
+ "type": "boolean",
312
+ "description": "Run build when files change.",
313
+ "default": false
314
+ },
315
+ "outputHashing": {
316
+ "type": "string",
317
+ "description": "Define the output filename cache-busting hashing mode.",
318
+ "default": "none",
319
+ "enum": ["none", "all", "media", "bundles"]
320
+ },
321
+ "poll": {
322
+ "type": "number",
323
+ "description": "Enable and define the file watching poll time period in milliseconds."
324
+ },
325
+ "deleteOutputPath": {
326
+ "type": "boolean",
327
+ "description": "Delete the output path before building.",
328
+ "default": true
329
+ },
330
+ "preserveSymlinks": {
331
+ "type": "boolean",
332
+ "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
333
+ },
334
+ "extractLicenses": {
335
+ "type": "boolean",
336
+ "description": "Extract all licenses in a separate file.",
337
+ "default": true
338
+ },
339
+ "buildOptimizer": {
340
+ "type": "boolean",
341
+ "description": "Enables advanced build optimizations when using the 'aot' option.",
342
+ "default": true
343
+ },
344
+ "namedChunks": {
345
+ "type": "boolean",
346
+ "description": "Use file name for lazy loaded chunks.",
347
+ "default": false
348
+ },
349
+ "subresourceIntegrity": {
350
+ "type": "boolean",
351
+ "description": "Enables the use of subresource integrity validation.",
352
+ "default": false
353
+ },
354
+ "serviceWorker": {
355
+ "type": "boolean",
356
+ "description": "Generates a service worker config for production builds.",
357
+ "default": false
358
+ },
359
+ "ngswConfigPath": {
360
+ "type": "string",
361
+ "description": "Path to ngsw-config.json."
362
+ },
363
+ "index": {
364
+ "description": "Configures the generation of the application's HTML index.",
365
+ "oneOf": [
366
+ {
367
+ "type": "string",
368
+ "description": "The path of a file to use for the application's HTML index. The filename of the specified path will be used for the generated file and will be created in the root of the application's configured output path."
369
+ },
370
+ {
371
+ "type": "object",
372
+ "description": "",
373
+ "properties": {
374
+ "input": {
375
+ "type": "string",
376
+ "minLength": 1,
377
+ "description": "The path of a file to use for the application's generated HTML index."
378
+ },
379
+ "output": {
380
+ "type": "string",
381
+ "minLength": 1,
382
+ "default": "index.html",
383
+ "description": "The output path of the application's generated HTML index file. The full provided path will be used and will be considered relative to the application's configured output path."
384
+ }
385
+ },
386
+ "required": ["input"]
387
+ }
388
+ ]
389
+ },
390
+ "statsJson": {
391
+ "type": "boolean",
392
+ "description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.",
393
+ "default": false
394
+ },
395
+ "budgets": {
396
+ "description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.",
397
+ "type": "array",
398
+ "items": {
399
+ "$ref": "#/definitions/budget"
400
+ },
401
+ "default": []
402
+ },
403
+ "webWorkerTsConfig": {
404
+ "type": "string",
405
+ "description": "TypeScript configuration for Web Worker modules."
406
+ },
407
+ "crossOrigin": {
408
+ "type": "string",
409
+ "description": "Define the crossorigin attribute setting of elements that provide CORS support.",
410
+ "default": "none",
411
+ "enum": ["none", "anonymous", "use-credentials"]
412
+ },
413
+ "allowedCommonJsDependencies": {
414
+ "description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
415
+ "type": "array",
416
+ "items": {
417
+ "type": "string"
418
+ },
419
+ "default": []
420
+ }
421
+ },
422
+ "additionalProperties": false,
423
+ "required": ["outputPath", "index", "main", "tsConfig"],
424
+ "definitions": {
425
+ "assetPattern": {
426
+ "oneOf": [
427
+ {
428
+ "type": "object",
429
+ "properties": {
430
+ "followSymlinks": {
431
+ "type": "boolean",
432
+ "default": false,
433
+ "description": "Allow glob patterns to follow symlink directories. This allows subdirectories of the symlink to be searched."
434
+ },
435
+ "glob": {
436
+ "type": "string",
437
+ "description": "The pattern to match."
438
+ },
439
+ "input": {
440
+ "type": "string",
441
+ "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
442
+ },
443
+ "ignore": {
444
+ "description": "An array of globs to ignore.",
445
+ "type": "array",
446
+ "items": {
447
+ "type": "string"
448
+ }
449
+ },
450
+ "output": {
451
+ "type": "string",
452
+ "description": "Absolute path within the output."
453
+ }
454
+ },
455
+ "additionalProperties": false,
456
+ "required": ["glob", "input", "output"]
457
+ },
458
+ {
459
+ "type": "string"
460
+ }
461
+ ]
462
+ },
463
+ "fileReplacement": {
464
+ "oneOf": [
465
+ {
466
+ "type": "object",
467
+ "properties": {
468
+ "src": {
469
+ "type": "string",
470
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
471
+ },
472
+ "replaceWith": {
473
+ "type": "string",
474
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
475
+ }
476
+ },
477
+ "additionalProperties": false,
478
+ "required": ["src", "replaceWith"]
479
+ },
480
+ {
481
+ "type": "object",
482
+ "properties": {
483
+ "replace": {
484
+ "type": "string",
485
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
486
+ },
487
+ "with": {
488
+ "type": "string",
489
+ "pattern": "\\.(([cm]?j|t)sx?|json)$"
490
+ }
491
+ },
492
+ "additionalProperties": false,
493
+ "required": ["replace", "with"]
494
+ }
495
+ ]
496
+ },
497
+ "budget": {
498
+ "type": "object",
499
+ "properties": {
500
+ "type": {
501
+ "type": "string",
502
+ "description": "The type of budget.",
503
+ "enum": ["all", "allScript", "any", "anyScript", "anyComponentStyle", "bundle", "initial"]
504
+ },
505
+ "name": {
506
+ "type": "string",
507
+ "description": "The name of the bundle."
508
+ },
509
+ "baseline": {
510
+ "type": "string",
511
+ "description": "The baseline size for comparison."
512
+ },
513
+ "maximumWarning": {
514
+ "type": "string",
515
+ "description": "The maximum threshold for warning relative to the baseline."
516
+ },
517
+ "maximumError": {
518
+ "type": "string",
519
+ "description": "The maximum threshold for error relative to the baseline."
520
+ },
521
+ "minimumWarning": {
522
+ "type": "string",
523
+ "description": "The minimum threshold for warning relative to the baseline."
524
+ },
525
+ "minimumError": {
526
+ "type": "string",
527
+ "description": "The minimum threshold for error relative to the baseline."
528
+ },
529
+ "warning": {
530
+ "type": "string",
531
+ "description": "The threshold for warning relative to the baseline (min & max)."
532
+ },
533
+ "error": {
534
+ "type": "string",
535
+ "description": "The threshold for error relative to the baseline (min & max)."
536
+ }
537
+ },
538
+ "additionalProperties": false,
539
+ "required": ["type"]
540
+ }
541
+ }
542
+ }
@@ -209,7 +209,9 @@ async function execute(options, context, transforms) {
209
209
  },
210
210
  });
211
211
  return partials;
212
- });
212
+ },
213
+ // During extraction we don't need specific browser support.
214
+ { supportedBrowsers: undefined });
213
215
  // All the localize usages are setup to first try the ESM entry point then fallback to the deep imports.
214
216
  // This provides interim compatibility while the framework is transitioned to bundled ESM packages.
215
217
  const localizeToolsModule = await (0, load_esm_1.loadEsmModule)('@angular/localize/tools');
@@ -107,8 +107,8 @@ function execute(options, context, transforms = {}) {
107
107
  throw new Error('The builder requires a target.');
108
108
  }
109
109
  const projectMetadata = await context.getProjectMetadata(projectName);
110
- const projectRoot = path.join(context.workspaceRoot, (_c = projectMetadata.root) !== null && _c !== void 0 ? _c : '');
111
- const projectSourceRoot = path.join(projectRoot, (_d = projectMetadata.sourceRoot) !== null && _d !== void 0 ? _d : '');
110
+ const sourceRoot = ((_d = (_c = projectMetadata.sourceRoot) !== null && _c !== void 0 ? _c : projectMetadata.root) !== null && _d !== void 0 ? _d : '');
111
+ const projectSourceRoot = path.join(context.workspaceRoot, sourceRoot);
112
112
  const files = await (0, find_tests_1.findTests)(options.include, context.workspaceRoot, projectSourceRoot);
113
113
  // early exit, no reason to start karma
114
114
  if (!files.length) {
@@ -125,8 +125,8 @@ function getInstrumentationExcludedPaths(sourceRoot, excludedPaths) {
125
125
  const excluded = new Set();
126
126
  for (const excludeGlob of excludedPaths) {
127
127
  glob_1.default
128
- .sync(path.join(sourceRoot, excludeGlob), { nodir: true })
129
- .forEach((p) => excluded.add(path.normalize(p)));
128
+ .sync(excludeGlob, { nodir: true, cwd: sourceRoot })
129
+ .forEach((p) => excluded.add(path.join(sourceRoot, p)));
130
130
  }
131
131
  return excluded;
132
132
  }