@angular-devkit/build-angular 14.0.0-next.0 → 14.0.0-next.11

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.
Files changed (80) hide show
  1. package/README.md +10 -10
  2. package/package.json +34 -35
  3. package/src/babel/plugins/pure-toplevel-functions.js +5 -1
  4. package/src/babel/presets/application.js +5 -1
  5. package/src/babel/webpack-loader.js +2 -22
  6. package/src/builders/app-shell/index.js +8 -4
  7. package/src/builders/app-shell/schema.d.ts +2 -2
  8. package/src/builders/app-shell/schema.json +2 -2
  9. package/src/builders/browser/index.d.ts +2 -3
  10. package/src/builders/browser/index.js +13 -10
  11. package/src/builders/browser/schema.d.ts +0 -1
  12. package/src/builders/browser/schema.json +2 -3
  13. package/src/builders/dev-server/index.d.ts +1 -1
  14. package/src/builders/dev-server/index.js +5 -1
  15. package/src/builders/dev-server/schema.d.ts +1 -1
  16. package/src/builders/dev-server/schema.json +1 -1
  17. package/src/builders/extract-i18n/index.d.ts +1 -1
  18. package/src/builders/extract-i18n/index.js +5 -1
  19. package/src/builders/extract-i18n/ivy-extract-loader.js +5 -1
  20. package/src/builders/karma/find-tests.js +5 -1
  21. package/src/builders/karma/index.d.ts +1 -1
  22. package/src/builders/karma/index.js +10 -6
  23. package/src/builders/ng-packagr/index.js +5 -1
  24. package/src/builders/protractor/index.d.ts +2 -1
  25. package/src/builders/protractor/index.js +5 -1
  26. package/src/builders/server/index.d.ts +2 -3
  27. package/src/builders/server/index.js +5 -1
  28. package/src/builders/server/schema.json +1 -2
  29. package/src/index.js +5 -1
  30. package/src/typings.d.ts +0 -4
  31. package/src/utils/check-port.js +8 -4
  32. package/src/utils/color.js +5 -1
  33. package/src/utils/copy-assets.js +5 -1
  34. package/src/utils/delete-output-dir.js +6 -9
  35. package/src/utils/environment-options.d.ts +0 -1
  36. package/src/utils/environment-options.js +1 -13
  37. package/src/utils/i18n-inlining.js +5 -1
  38. package/src/utils/i18n-options.js +1 -8
  39. package/src/utils/index-file/html-rewriting-stream.js +5 -1
  40. package/src/utils/index-file/index-html-generator.js +5 -1
  41. package/src/utils/index-file/inline-critical-css.js +5 -1
  42. package/src/utils/index-file/inline-fonts.js +5 -1
  43. package/src/utils/index.js +5 -1
  44. package/src/utils/load-translations.js +5 -1
  45. package/src/utils/normalize-asset-patterns.d.ts +2 -2
  46. package/src/utils/normalize-asset-patterns.js +34 -10
  47. package/src/utils/normalize-builder-schema.d.ts +2 -2
  48. package/src/utils/normalize-builder-schema.js +5 -6
  49. package/src/utils/normalize-cache.js +0 -4
  50. package/src/utils/normalize-file-replacements.d.ts +4 -4
  51. package/src/utils/normalize-file-replacements.js +38 -18
  52. package/src/utils/process-bundle.js +6 -2
  53. package/src/utils/purge-cache.js +3 -8
  54. package/src/utils/read-tsconfig.js +5 -1
  55. package/src/utils/service-worker.d.ts +1 -2
  56. package/src/utils/service-worker.js +13 -11
  57. package/src/utils/webpack-browser-config.js +14 -12
  58. package/src/webpack/configs/analytics.js +1 -4
  59. package/src/webpack/configs/common.js +10 -12
  60. package/src/webpack/configs/dev-server.js +6 -2
  61. package/src/webpack/configs/index.js +5 -1
  62. package/src/webpack/configs/styles.js +14 -21
  63. package/src/webpack/plugins/analytics.d.ts +1 -2
  64. package/src/webpack/plugins/analytics.js +1 -3
  65. package/src/webpack/plugins/any-component-style-budget-checker.js +5 -1
  66. package/src/webpack/plugins/common-js-usage-warn-plugin.js +2 -2
  67. package/src/webpack/plugins/css-optimizer-plugin.js +7 -3
  68. package/src/webpack/plugins/esbuild-executor.d.ts +2 -2
  69. package/src/webpack/plugins/esbuild-executor.js +11 -17
  70. package/src/webpack/plugins/javascript-optimizer-plugin.js +8 -4
  71. package/src/webpack/plugins/json-stats-plugin.js +5 -1
  72. package/src/webpack/plugins/karma/karma.js +37 -42
  73. package/src/webpack/plugins/named-chunks-plugin.js +9 -0
  74. package/src/webpack/plugins/postcss-cli-resources.js +7 -3
  75. package/src/webpack/plugins/scripts-webpack-plugin.js +5 -1
  76. package/src/webpack/plugins/transfer-size-plugin.js +3 -2
  77. package/src/webpack/plugins/typescript.js +1 -2
  78. package/src/webpack/utils/helpers.js +5 -1
  79. package/src/webpack/utils/stats.js +5 -1
  80. package/esbuild-check.js +0 -16
package/README.md CHANGED
@@ -4,16 +4,16 @@ This package contains [Architect builders](/packages/angular_devkit/architect/RE
4
4
 
5
5
  ## Builders
6
6
 
7
- | Name | Description |
8
- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9
- | app-shell | Build an Angular [App shell](https://angular.io/guide/app-shell). |
10
- | browser | Build an Angular application targeting a browser environment. |
11
- | dev-server | A development server that provides live reloading. |
12
- | extract-i18n | Extract i18n messages from an Angular application. |
13
- | karma | Execute unit tests using [Karma](https://github.com/karma-runner/karma) test runner. |
14
- | ng-packagr | Build and package an Angular library in [Angular Package Format (APF)](https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview) format using [ng-packagr](https://github.com/ng-packagr/ng-packagr). |
15
- | server | Build an Angular application targeting a [Node.js](https://nodejs.org) environment. |
16
- | protractor | **Deprecated** - Run end-to-end tests using [Protractor](https://www.protractortest.org/) framework. |
7
+ | Name | Description |
8
+ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9
+ | app-shell | Build an Angular [App shell](https://angular.io/guide/app-shell). |
10
+ | browser | Build an Angular application targeting a browser environment. |
11
+ | dev-server | A development server that provides live reloading. |
12
+ | extract-i18n | Extract i18n messages from an Angular application. |
13
+ | karma | Execute unit tests using [Karma](https://github.com/karma-runner/karma) test runner. |
14
+ | ng-packagr | Build and package an Angular library in [Angular Package Format (APF)](https://angular.io/guide/angular-package-format) format using [ng-packagr](https://github.com/ng-packagr/ng-packagr). |
15
+ | server | Build an Angular application targeting a [Node.js](https://nodejs.org) environment. |
16
+ | protractor | **Deprecated** - Run end-to-end tests using [Protractor](https://www.protractortest.org/) framework. |
17
17
 
18
18
  ## Disclaimer
19
19
 
package/package.json CHANGED
@@ -1,77 +1,76 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "14.0.0-next.0",
3
+ "version": "14.0.0-next.11",
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
- "@ampproject/remapping": "2.0.1",
10
- "@angular-devkit/architect": "0.1400.0-next.0",
11
- "@angular-devkit/build-webpack": "0.1400.0-next.0",
12
- "@angular-devkit/core": "14.0.0-next.0",
13
- "@babel/core": "7.16.12",
14
- "@babel/generator": "7.16.8",
9
+ "@ampproject/remapping": "2.1.2",
10
+ "@angular-devkit/architect": "0.1400.0-next.11",
11
+ "@angular-devkit/build-webpack": "0.1400.0-next.11",
12
+ "@angular-devkit/core": "14.0.0-next.11",
13
+ "@babel/core": "7.17.9",
14
+ "@babel/generator": "7.17.9",
15
15
  "@babel/helper-annotate-as-pure": "7.16.7",
16
16
  "@babel/plugin-proposal-async-generator-functions": "7.16.8",
17
17
  "@babel/plugin-transform-async-to-generator": "7.16.8",
18
- "@babel/plugin-transform-runtime": "7.16.10",
18
+ "@babel/plugin-transform-runtime": "7.17.0",
19
19
  "@babel/preset-env": "7.16.11",
20
- "@babel/runtime": "7.16.7",
20
+ "@babel/runtime": "7.17.9",
21
21
  "@babel/template": "7.16.7",
22
- "@discoveryjs/json-ext": "0.5.6",
23
- "@ngtools/webpack": "14.0.0-next.0",
22
+ "@discoveryjs/json-ext": "0.5.7",
23
+ "@ngtools/webpack": "14.0.0-next.11",
24
24
  "ansi-colors": "4.1.1",
25
- "babel-loader": "8.2.3",
25
+ "babel-loader": "8.2.4",
26
26
  "babel-plugin-istanbul": "6.1.1",
27
27
  "browserslist": "^4.9.1",
28
- "cacache": "15.3.0",
28
+ "cacache": "16.0.4",
29
29
  "copy-webpack-plugin": "10.2.4",
30
- "core-js": "3.21.0",
31
30
  "critters": "0.0.16",
32
- "css-loader": "6.6.0",
33
- "esbuild-wasm": "0.14.17",
34
- "glob": "7.2.0",
35
- "https-proxy-agent": "5.0.0",
36
- "inquirer": "8.2.0",
31
+ "css-loader": "6.7.1",
32
+ "esbuild-wasm": "0.14.36",
33
+ "glob": "8.0.1",
34
+ "https-proxy-agent": "5.0.1",
35
+ "inquirer": "8.2.2",
37
36
  "jsonc-parser": "3.0.0",
38
37
  "karma-source-map-support": "1.4.0",
39
38
  "less": "4.1.2",
40
39
  "less-loader": "10.2.0",
41
- "license-webpack-plugin": "4.0.1",
40
+ "license-webpack-plugin": "4.0.2",
42
41
  "loader-utils": "3.2.0",
43
- "mini-css-extract-plugin": "2.5.3",
44
- "minimatch": "3.0.4",
42
+ "mini-css-extract-plugin": "2.6.0",
43
+ "minimatch": "5.0.1",
45
44
  "open": "8.4.0",
46
45
  "ora": "5.4.1",
47
46
  "parse5-html-rewriting-stream": "6.0.1",
48
47
  "piscina": "3.2.0",
49
- "postcss": "8.4.6",
50
- "postcss-import": "14.0.2",
48
+ "postcss": "8.4.12",
49
+ "postcss-import": "14.1.0",
51
50
  "postcss-loader": "6.2.1",
52
- "postcss-preset-env": "7.3.0",
51
+ "postcss-preset-env": "7.4.3",
53
52
  "regenerator-runtime": "0.13.9",
54
53
  "resolve-url-loader": "5.0.0",
55
54
  "rxjs": "6.6.7",
56
- "sass": "1.49.7",
57
- "sass-loader": "12.4.0",
58
- "semver": "7.3.5",
55
+ "sass": "1.50.1",
56
+ "sass-loader": "12.6.0",
57
+ "semver": "7.3.7",
59
58
  "source-map-loader": "3.0.1",
60
59
  "source-map-support": "0.5.21",
61
- "stylus": "0.56.0",
60
+ "stylus": "0.57.0",
62
61
  "stylus-loader": "6.2.0",
63
- "terser": "5.10.0",
62
+ "terser": "5.12.1",
64
63
  "text-table": "0.2.0",
65
64
  "tree-kill": "1.2.2",
66
65
  "tslib": "2.3.1",
67
- "webpack": "5.68.0",
66
+ "webpack": "5.72.0",
68
67
  "webpack-dev-middleware": "5.3.1",
69
- "webpack-dev-server": "4.7.4",
68
+ "webpack-dev-server": "4.8.1",
70
69
  "webpack-merge": "5.8.0",
71
70
  "webpack-subresource-integrity": "5.1.0"
72
71
  },
73
72
  "optionalDependencies": {
74
- "esbuild": "0.14.17"
73
+ "esbuild": "0.14.36"
75
74
  },
76
75
  "peerDependencies": {
77
76
  "@angular/compiler-cli": "^14.0.0 || ^14.0.0-next",
@@ -81,7 +80,7 @@
81
80
  "ng-packagr": "^14.0.0 || ^14.0.0-next",
82
81
  "protractor": "^7.0.0",
83
82
  "tailwindcss": "^2.0.0 || ^3.0.0",
84
- "typescript": ">=4.4.3 <4.6"
83
+ "typescript": "~4.6.2"
85
84
  },
86
85
  "peerDependenciesMeta": {
87
86
  "@angular/localize": {
@@ -115,7 +114,7 @@
115
114
  "url": "https://github.com/angular/angular-cli.git"
116
115
  },
117
116
  "engines": {
118
- "node": "^12.20.0 || ^14.15.0 || >=16.10.0",
117
+ "node": "^14.15.0 || >=16.10.0",
119
118
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
120
119
  "yarn": ">= 1.13.0"
121
120
  },
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -6,11 +6,7 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
8
8
  */
9
- var __importDefault = (this && this.__importDefault) || function (mod) {
10
- return (mod && mod.__esModule) ? mod : { "default": mod };
11
- };
12
9
  Object.defineProperty(exports, "__esModule", { value: true });
13
- const remapping_1 = __importDefault(require("@ampproject/remapping"));
14
10
  const babel_loader_1 = require("babel-loader");
15
11
  const typescript_1 = require("typescript");
16
12
  const load_esm_1 = require("../utils/load-esm");
@@ -166,12 +162,13 @@ exports.default = (0, babel_loader_1.custom)(() => {
166
162
  return { custom: customOptions, loader: loaderOptions };
167
163
  },
168
164
  config(configuration, { customOptions }) {
165
+ var _a;
169
166
  return {
170
167
  ...configuration.options,
171
168
  // Using `false` disables babel from attempting to locate sourcemaps or process any inline maps.
172
169
  // The babel types do not include the false option even though it is valid
173
170
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
174
- inputSourceMap: false,
171
+ inputSourceMap: (_a = configuration.options.inputSourceMap) !== null && _a !== void 0 ? _a : false,
175
172
  presets: [
176
173
  ...(configuration.options.presets || []),
177
174
  [
@@ -195,22 +192,5 @@ exports.default = (0, babel_loader_1.custom)(() => {
195
192
  ],
196
193
  };
197
194
  },
198
- result(result, { map: inputSourceMap }) {
199
- if (result.map && inputSourceMap) {
200
- // Merge the intermediate sourcemap generated by babel with the input source map.
201
- // The casting is required due to slight differences in the types for babel and
202
- // `@ampproject/remapping` source map objects but both are compatible with Webpack.
203
- // This method for merging is used because it provides more accurate output
204
- // and is faster while using less memory.
205
- result.map = {
206
- // Convert the SourceMap back to simple plain object.
207
- // This is needed because otherwise code-coverage will fail with `don't know how to turn this value into a node`
208
- // Which is thrown by Babel if it is invoked again from `istanbul-lib-instrument`.
209
- // https://github.com/babel/babel/blob/780aa48d2a34dc55f556843074b6aed45e7eabeb/packages/babel-types/src/converters/valueToNode.ts#L115-L130
210
- ...(0, remapping_1.default)([result.map, inputSourceMap], () => null),
211
- };
212
- }
213
- return result;
214
- },
215
195
  };
216
196
  });
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -27,7 +31,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
27
31
  };
28
32
  Object.defineProperty(exports, "__esModule", { value: true });
29
33
  const architect_1 = require("@angular-devkit/architect");
30
- const core_1 = require("@angular-devkit/core");
31
34
  const fs = __importStar(require("fs"));
32
35
  const path = __importStar(require("path"));
33
36
  const utils_1 = require("../../utils");
@@ -35,6 +38,7 @@ const inline_critical_css_1 = require("../../utils/index-file/inline-critical-cs
35
38
  const service_worker_1 = require("../../utils/service-worker");
36
39
  const spinner_1 = require("../../utils/spinner");
37
40
  async function _renderUniversal(options, context, browserResult, serverResult, spinner) {
41
+ var _a;
38
42
  // Get browser target options.
39
43
  const browserTarget = (0, architect_1.targetFromTargetString)(options.browserTarget);
40
44
  const rawBrowserOptions = (await context.getTargetOptions(browserTarget));
@@ -49,7 +53,7 @@ async function _renderUniversal(options, context, browserResult, serverResult, s
49
53
  throw new Error('The builder requires a target.');
50
54
  }
51
55
  const projectMetadata = await context.getProjectMetadata(projectName);
52
- const projectRoot = (0, core_1.resolve)((0, core_1.normalize)(root), (0, core_1.normalize)(projectMetadata.root || ''));
56
+ const projectRoot = path.join(root, (_a = projectMetadata.root) !== null && _a !== void 0 ? _a : '');
53
57
  const { styles } = (0, utils_1.normalizeOptimization)(browserOptions.optimization);
54
58
  const inlineCriticalCssProcessor = styles.inlineCritical
55
59
  ? new inline_critical_css_1.InlineCriticalCssProcessor({
@@ -91,7 +95,7 @@ async function _renderUniversal(options, context, browserResult, serverResult, s
91
95
  }
92
96
  await fs.promises.writeFile(outputIndexPath, html);
93
97
  if (browserOptions.serviceWorker) {
94
- await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, (0, core_1.normalize)(outputPath), browserOptions.baseHref || '/', browserOptions.ngswConfigPath);
98
+ await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, outputPath, browserOptions.baseHref || '/', browserOptions.ngswConfigPath);
95
99
  }
96
100
  }
97
101
  return browserResult;
@@ -9,7 +9,7 @@ export interface Schema {
9
9
  */
10
10
  appModuleBundle?: string;
11
11
  /**
12
- * A browser builder target use for rendering the app shell in the format of
12
+ * A browser builder target use for rendering the application shell in the format of
13
13
  * `project:target[:configuration]`. You can also pass in more than one configuration name
14
14
  * as a comma-separated list. Example: `project:target:production,staging`.
15
15
  */
@@ -28,7 +28,7 @@ export interface Schema {
28
28
  */
29
29
  route?: string;
30
30
  /**
31
- * A server builder target use for rendering the app shell in the format of
31
+ * A server builder target use for rendering the application shell in the format of
32
32
  * `project:target[:configuration]`. You can also pass in more than one configuration name
33
33
  * as a comma-separated list. Example: `project:target:production,staging`.
34
34
  */
@@ -6,12 +6,12 @@
6
6
  "properties": {
7
7
  "browserTarget": {
8
8
  "type": "string",
9
- "description": "A browser builder target use for rendering the app shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
9
+ "description": "A browser builder target use for rendering the application shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
10
10
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
11
11
  },
12
12
  "serverTarget": {
13
13
  "type": "string",
14
- "description": "A server builder target use for rendering the app shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
14
+ "description": "A server builder target use for rendering the application shell in the format of `project:target[:configuration]`. You can also pass in more than one configuration name as a comma-separated list. Example: `project:target:production,staging`.",
15
15
  "pattern": "^[^:\\s]+:[^:\\s]+(:[^\\s]+)?$"
16
16
  },
17
17
  "appModuleBundle": {
@@ -7,7 +7,6 @@
7
7
  */
8
8
  import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
9
9
  import { WebpackLoggingCallback } from '@angular-devkit/build-webpack';
10
- import { json } from '@angular-devkit/core';
11
10
  import { Observable } from 'rxjs';
12
11
  import webpack from 'webpack';
13
12
  import { ExecutionTransformer } from '../../transforms';
@@ -16,7 +15,7 @@ import { Schema as BrowserBuilderSchema } from './schema';
16
15
  /**
17
16
  * @experimental Direct usage of this type is considered experimental.
18
17
  */
19
- export declare type BrowserBuilderOutput = json.JsonObject & BuilderOutput & {
18
+ export declare type BrowserBuilderOutput = BuilderOutput & {
20
19
  baseOutputPath: string;
21
20
  outputPaths: string[];
22
21
  /**
@@ -37,5 +36,5 @@ export declare function buildWebpackBrowser(options: BrowserBuilderSchema, conte
37
36
  logging?: WebpackLoggingCallback;
38
37
  indexHtml?: IndexHtmlTransform;
39
38
  }): Observable<BrowserBuilderOutput>;
40
- declare const _default: import("@angular-devkit/architect/src/internal").Builder<json.JsonObject & BrowserBuilderSchema>;
39
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<BrowserBuilderSchema & import("@angular-devkit/core").JsonObject>;
41
40
  export default _default;
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -29,7 +33,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
33
  exports.buildWebpackBrowser = exports.BUILD_TIMEOUT = void 0;
30
34
  const architect_1 = require("@angular-devkit/architect");
31
35
  const build_webpack_1 = require("@angular-devkit/build-webpack");
32
- const core_1 = require("@angular-devkit/core");
33
36
  const fs = __importStar(require("fs"));
34
37
  const path = __importStar(require("path"));
35
38
  const rxjs_1 = require("rxjs");
@@ -71,7 +74,7 @@ async function initialize(options, context, webpackConfigurationTransform) {
71
74
  ]);
72
75
  // Validate asset option values if processed directly
73
76
  if (((_a = options.assets) === null || _a === void 0 ? void 0 : _a.length) && !((_b = adjustedOptions.assets) === null || _b === void 0 ? void 0 : _b.length)) {
74
- (0, utils_1.normalizeAssetPatterns)(options.assets, (0, core_1.normalize)(context.workspaceRoot), (0, core_1.normalize)(projectRoot), projectSourceRoot === undefined ? undefined : (0, core_1.normalize)(projectSourceRoot)).forEach(({ output }) => {
77
+ (0, utils_1.normalizeAssetPatterns)(options.assets, context.workspaceRoot, projectRoot, projectSourceRoot).forEach(({ output }) => {
75
78
  if (output.startsWith('..')) {
76
79
  throw new Error('An asset cannot be written to a location outside of the output path.');
77
80
  }
@@ -92,7 +95,6 @@ async function initialize(options, context, webpackConfigurationTransform) {
92
95
  // eslint-disable-next-line max-lines-per-function
93
96
  function buildWebpackBrowser(options, context, transforms = {}) {
94
97
  var _a;
95
- const root = (0, core_1.normalize)(context.workspaceRoot);
96
98
  const projectName = (_a = context.target) === null || _a === void 0 ? void 0 : _a.project;
97
99
  if (!projectName) {
98
100
  throw new Error('The builder requires a target.');
@@ -102,13 +104,14 @@ function buildWebpackBrowser(options, context, transforms = {}) {
102
104
  // Check Angular version.
103
105
  (0, version_1.assertCompatibleAngularVersion)(context.workspaceRoot);
104
106
  return (0, rxjs_1.from)(context.getProjectMetadata(projectName)).pipe((0, operators_1.switchMap)(async (projectMetadata) => {
105
- var _a;
106
- const sysProjectRoot = (0, core_1.getSystemPath)((0, core_1.resolve)((0, core_1.normalize)(context.workspaceRoot), (0, core_1.normalize)((_a = projectMetadata.root) !== null && _a !== void 0 ? _a : '')));
107
107
  // Purge old build disk cache.
108
108
  await (0, purge_cache_1.purgeStaleBuildCache)(context);
109
- checkInternetExplorerSupport(sysProjectRoot, context.logger);
109
+ // Initialize builder
110
+ const initialization = await initialize(options, context, transforms.webpackConfiguration);
111
+ // Check and warn about IE browser support
112
+ checkInternetExplorerSupport(initialization.projectRoot, context.logger);
110
113
  return {
111
- ...(await initialize(options, context, transforms.webpackConfiguration)),
114
+ ...initialization,
112
115
  cacheOptions: (0, normalize_cache_1.normalizeCacheOptions)(projectMetadata, context.workspaceRoot),
113
116
  };
114
117
  }), (0, operators_1.switchMap)(
@@ -185,7 +188,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
185
188
  if (!options.watch && ((_c = options.assets) === null || _c === void 0 ? void 0 : _c.length)) {
186
189
  spinner.start('Copying assets...');
187
190
  try {
188
- await (0, copy_assets_1.copyAssets)((0, utils_1.normalizeAssetPatterns)(options.assets, root, (0, core_1.normalize)(projectRoot), projectSourceRoot === undefined ? undefined : (0, core_1.normalize)(projectSourceRoot)), Array.from(outputPaths.values()), context.workspaceRoot);
191
+ await (0, copy_assets_1.copyAssets)((0, utils_1.normalizeAssetPatterns)(options.assets, context.workspaceRoot, projectRoot, projectSourceRoot), Array.from(outputPaths.values()), context.workspaceRoot);
189
192
  spinner.succeed('Copying assets complete.');
190
193
  }
191
194
  catch (err) {
@@ -249,7 +252,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
249
252
  spinner.start('Generating service worker...');
250
253
  for (const [locale, outputPath] of outputPaths.entries()) {
251
254
  try {
252
- await (0, service_worker_1.augmentAppWithServiceWorker)((0, core_1.normalize)(projectRoot), (0, core_1.normalize)(outputPath), getLocaleBaseHref(i18n, locale) || options.baseHref || '/', options.ngswConfigPath);
255
+ await (0, service_worker_1.augmentAppWithServiceWorker)(projectRoot, outputPath, getLocaleBaseHref(i18n, locale) || options.baseHref || '/', options.ngswConfigPath);
253
256
  }
254
257
  catch (error) {
255
258
  spinner.fail('Service worker generation failed.');
@@ -98,7 +98,6 @@ export interface Schema {
98
98
  outputHashing?: OutputHashing;
99
99
  /**
100
100
  * The full path for the new output directory, relative to the current workspace.
101
- *
102
101
  * By default, writes output to a folder named dist/ in the current project.
103
102
  */
104
103
  outputPath: string;
@@ -193,12 +193,11 @@
193
193
  },
194
194
  "outputPath": {
195
195
  "type": "string",
196
- "description": "The full path for the new output directory, relative to the current workspace.\n\nBy default, writes output to a folder named dist/ in the current project."
196
+ "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."
197
197
  },
198
198
  "resourcesOutputPath": {
199
199
  "type": "string",
200
- "description": "The path where style resources will be placed, relative to outputPath.",
201
- "default": ""
200
+ "description": "The path where style resources will be placed, relative to outputPath."
202
201
  },
203
202
  "aot": {
204
203
  "type": "boolean",
@@ -13,7 +13,7 @@ import webpack from 'webpack';
13
13
  import { ExecutionTransformer } from '../../transforms';
14
14
  import { IndexHtmlTransform } from '../../utils/index-file/index-html-generator';
15
15
  import { Schema } from './schema';
16
- export declare type DevServerBuilderOptions = Schema & json.JsonObject;
16
+ export declare type DevServerBuilderOptions = Schema;
17
17
  /**
18
18
  * @experimental Direct usage of this type is considered experimental.
19
19
  */
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -58,7 +58,7 @@ export interface Schema {
58
58
  */
59
59
  publicHost?: string;
60
60
  /**
61
- * The pathname where the app will be served.
61
+ * The pathname where the application will be served.
62
62
  */
63
63
  servePath?: string;
64
64
  /**
@@ -75,7 +75,7 @@
75
75
  },
76
76
  "servePath": {
77
77
  "type": "string",
78
- "description": "The pathname where the app will be served."
78
+ "description": "The pathname where the application will be served."
79
79
  },
80
80
  "disableHostCheck": {
81
81
  "type": "boolean",
@@ -11,7 +11,7 @@ import { JsonObject } from '@angular-devkit/core';
11
11
  import webpack from 'webpack';
12
12
  import { ExecutionTransformer } from '../../transforms';
13
13
  import { Schema } from './schema';
14
- export declare type ExtractI18nBuilderOptions = Schema & JsonObject;
14
+ export declare type ExtractI18nBuilderOptions = Schema;
15
15
  /**
16
16
  * @experimental Direct usage of this function is considered experimental.
17
17
  */
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -23,5 +23,5 @@ export declare function execute(options: KarmaBuilderOptions, context: BuilderCo
23
23
  karmaOptions?: (options: KarmaConfigOptions) => KarmaConfigOptions;
24
24
  }): Observable<BuilderOutput>;
25
25
  export { KarmaBuilderOptions };
26
- declare const _default: import("@angular-devkit/architect/src/internal").Builder<Record<string, string> & KarmaBuilderOptions & import("@angular-devkit/core").JsonObject>;
26
+ declare const _default: import("@angular-devkit/architect/src/internal").Builder<Record<string, string> & KarmaBuilderOptions & import("../../../../core/src").JsonObject>;
27
27
  export default _default;
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];
@@ -28,8 +32,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
32
  Object.defineProperty(exports, "__esModule", { value: true });
29
33
  exports.execute = void 0;
30
34
  const architect_1 = require("@angular-devkit/architect");
31
- const core_1 = require("@angular-devkit/core");
32
- const path_1 = require("path");
35
+ const path = __importStar(require("path"));
33
36
  const rxjs_1 = require("rxjs");
34
37
  const operators_1 = require("rxjs/operators");
35
38
  const purge_cache_1 = require("../../utils/purge-cache");
@@ -104,7 +107,8 @@ function execute(options, context, transforms = {}) {
104
107
  throw new Error('The builder requires a target.');
105
108
  }
106
109
  const projectMetadata = await context.getProjectMetadata(projectName);
107
- const projectSourceRoot = (0, core_1.getSystemPath)((0, core_1.join)((0, core_1.normalize)(context.workspaceRoot), (_c = projectMetadata.root) !== null && _c !== void 0 ? _c : '', (_d = projectMetadata.sourceRoot) !== null && _d !== void 0 ? _d : ''));
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 : '');
108
112
  const files = await (0, find_tests_1.findTests)(options.include, context.workspaceRoot, projectSourceRoot);
109
113
  // early exit, no reason to start karma
110
114
  if (!files.length) {
@@ -119,7 +123,7 @@ function execute(options, context, transforms = {}) {
119
123
  webpackConfig.module.rules = rules;
120
124
  }
121
125
  rules.unshift({
122
- test: (0, path_1.resolve)(context.workspaceRoot, options.main),
126
+ test: path.resolve(context.workspaceRoot, options.main),
123
127
  use: {
124
128
  // cannot be a simple path as it differs between environments
125
129
  loader: single_test_transform_1.SingleTestTransformLoader,
@@ -135,7 +139,7 @@ function execute(options, context, transforms = {}) {
135
139
  webpackConfig,
136
140
  logger: context.logger,
137
141
  };
138
- const config = await karma.config.parseConfig((0, path_1.resolve)(context.workspaceRoot, options.karmaConfig), transforms.karmaOptions ? transforms.karmaOptions(karmaOptions) : karmaOptions, { promiseConfig: true, throwErrors: true });
142
+ const config = await karma.config.parseConfig(path.resolve(context.workspaceRoot, options.karmaConfig), transforms.karmaOptions ? transforms.karmaOptions(karmaOptions) : karmaOptions, { promiseConfig: true, throwErrors: true });
139
143
  return [karma, config];
140
144
  }), (0, operators_1.switchMap)(([karma, karmaConfig]) => new rxjs_1.Observable((subscriber) => {
141
145
  var _a, _b, _c;
@@ -8,7 +8,11 @@
8
8
  */
9
9
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
10
  if (k2 === undefined) k2 = k;
11
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
12
16
  }) : (function(o, m, k, k2) {
13
17
  if (k2 === undefined) k2 = k;
14
18
  o[k2] = m[k];