@angular-devkit/build-angular 19.2.0-next.1 → 19.2.0-rc.0

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 (51) hide show
  1. package/package.json +23 -23
  2. package/src/builders/app-shell/index.js +2 -2
  3. package/src/builders/browser/index.js +2 -2
  4. package/src/builders/dev-server/builder.js +0 -3
  5. package/src/builders/dev-server/webpack-server.js +2 -2
  6. package/src/builders/extract-i18n/ivy-extract-loader.js +1 -1
  7. package/src/builders/jest/index.js +1 -1
  8. package/src/builders/jest/schema.d.ts +4 -0
  9. package/src/builders/jest/schema.json +5 -0
  10. package/src/builders/karma/browser_builder.js +2 -2
  11. package/src/builders/karma/find-tests-plugin.js +4 -4
  12. package/src/builders/karma/index.js +22 -7
  13. package/src/builders/karma/schema.d.ts +4 -0
  14. package/src/builders/karma/schema.json +5 -0
  15. package/src/builders/prerender/index.js +2 -2
  16. package/src/builders/protractor/index.js +3 -3
  17. package/src/builders/ssr-dev-server/index.js +5 -5
  18. package/src/builders/ssr-dev-server/utils.d.ts +1 -1
  19. package/src/builders/ssr-dev-server/utils.js +5 -5
  20. package/src/builders/web-test-runner/index.js +1 -1
  21. package/src/builders/web-test-runner/schema.d.ts +4 -0
  22. package/src/builders/web-test-runner/schema.json +5 -0
  23. package/src/tools/webpack/configs/common.js +1 -1
  24. package/src/tools/webpack/configs/dev-server.js +15 -15
  25. package/src/tools/webpack/plugins/any-component-style-budget-checker.js +1 -1
  26. package/src/tools/webpack/plugins/common-js-usage-warn-plugin.js +2 -2
  27. package/src/tools/webpack/plugins/hmr/hmr-loader.js +2 -2
  28. package/src/tools/webpack/plugins/index-html-webpack-plugin.js +4 -4
  29. package/src/tools/webpack/plugins/postcss-cli-resources.js +2 -2
  30. package/src/tools/webpack/plugins/scripts-webpack-plugin.js +1 -1
  31. package/src/tools/webpack/plugins/styles-webpack-plugin.js +3 -3
  32. package/src/tools/webpack/plugins/transfer-size-plugin.js +3 -3
  33. package/src/tools/webpack/utils/helpers.js +3 -3
  34. package/src/utils/error.js +2 -2
  35. package/src/utils/i18n-inlining.js +2 -2
  36. package/src/utils/normalize-asset-patterns.js +3 -3
  37. package/src/utils/normalize-cache.js +1 -1
  38. package/src/utils/normalize-file-replacements.js +4 -4
  39. package/src/utils/normalize-polyfills.js +4 -4
  40. package/src/utils/output-paths.js +5 -5
  41. package/src/utils/process-bundle.js +4 -4
  42. package/src/utils/read-tsconfig.js +1 -1
  43. package/src/utils/run-module-as-observable-fork.js +4 -4
  44. package/src/utils/webpack-browser-config.js +1 -1
  45. package/src/builders/karma/application_builder.d.ts +0 -19
  46. package/src/builders/karma/application_builder.js +0 -458
  47. package/src/builders/karma/find-tests.d.ts +0 -15
  48. package/src/builders/karma/find-tests.js +0 -144
  49. package/src/builders/karma/init_test_bed.js +0 -19
  50. package/src/builders/karma/jasmine_global.js +0 -18
  51. package/src/builders/karma/jasmine_global_cleanup.js +0 -14
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "19.2.0-next.1",
3
+ "version": "19.2.0-rc.0",
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.3.0",
10
- "@angular-devkit/architect": "0.1902.0-next.1",
11
- "@angular-devkit/build-webpack": "0.1902.0-next.1",
12
- "@angular-devkit/core": "19.2.0-next.1",
13
- "@angular/build": "19.2.0-next.1",
14
- "@babel/core": "7.26.7",
15
- "@babel/generator": "7.26.5",
10
+ "@angular-devkit/architect": "0.1902.0-rc.0",
11
+ "@angular-devkit/build-webpack": "0.1902.0-rc.0",
12
+ "@angular-devkit/core": "19.2.0-rc.0",
13
+ "@angular/build": "19.2.0-rc.0",
14
+ "@babel/core": "7.26.9",
15
+ "@babel/generator": "7.26.9",
16
16
  "@babel/helper-annotate-as-pure": "7.25.9",
17
17
  "@babel/helper-split-export-declaration": "7.24.7",
18
- "@babel/plugin-transform-async-generator-functions": "7.25.9",
18
+ "@babel/plugin-transform-async-generator-functions": "7.26.8",
19
19
  "@babel/plugin-transform-async-to-generator": "7.25.9",
20
- "@babel/plugin-transform-runtime": "7.25.9",
21
- "@babel/preset-env": "7.26.7",
22
- "@babel/runtime": "7.26.7",
20
+ "@babel/plugin-transform-runtime": "7.26.9",
21
+ "@babel/preset-env": "7.26.9",
22
+ "@babel/runtime": "7.26.9",
23
23
  "@discoveryjs/json-ext": "0.6.3",
24
- "@ngtools/webpack": "19.2.0-next.1",
24
+ "@ngtools/webpack": "19.2.0-rc.0",
25
25
  "@vitejs/plugin-basic-ssl": "1.2.0",
26
26
  "ansi-colors": "4.1.3",
27
27
  "autoprefixer": "10.4.20",
@@ -29,7 +29,7 @@
29
29
  "browserslist": "^4.21.5",
30
30
  "copy-webpack-plugin": "12.0.2",
31
31
  "css-loader": "7.1.2",
32
- "esbuild-wasm": "0.24.2",
32
+ "esbuild-wasm": "0.25.0",
33
33
  "fast-glob": "3.3.3",
34
34
  "http-proxy-middleware": "3.0.3",
35
35
  "istanbul-lib-instrument": "6.0.3",
@@ -44,34 +44,34 @@
44
44
  "ora": "5.4.1",
45
45
  "picomatch": "4.0.2",
46
46
  "piscina": "4.8.0",
47
- "postcss": "8.5.1",
47
+ "postcss": "8.5.2",
48
48
  "postcss-loader": "8.1.1",
49
49
  "resolve-url-loader": "5.0.0",
50
50
  "rxjs": "7.8.1",
51
- "sass": "1.83.4",
52
- "sass-loader": "16.0.4",
53
- "semver": "7.6.3",
51
+ "sass": "1.85.0",
52
+ "sass-loader": "16.0.5",
53
+ "semver": "7.7.1",
54
54
  "source-map-loader": "5.0.0",
55
55
  "source-map-support": "0.5.21",
56
- "terser": "5.37.0",
56
+ "terser": "5.39.0",
57
57
  "tree-kill": "1.2.2",
58
58
  "tslib": "2.8.1",
59
- "webpack": "5.97.1",
59
+ "webpack": "5.98.0",
60
60
  "webpack-dev-middleware": "7.4.2",
61
61
  "webpack-dev-server": "5.2.0",
62
62
  "webpack-merge": "6.0.1",
63
63
  "webpack-subresource-integrity": "5.1.0"
64
64
  },
65
65
  "optionalDependencies": {
66
- "esbuild": "0.24.2"
66
+ "esbuild": "0.25.0"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "@angular/compiler-cli": "^19.0.0 || ^19.2.0-next.0",
70
70
  "@angular/localize": "^19.0.0 || ^19.2.0-next.0",
71
71
  "@angular/platform-server": "^19.0.0 || ^19.2.0-next.0",
72
72
  "@angular/service-worker": "^19.0.0 || ^19.2.0-next.0",
73
- "@angular/ssr": "^19.2.0-next.1",
74
- "@web/test-runner": "^0.19.0",
73
+ "@angular/ssr": "^19.2.0-rc.0",
74
+ "@web/test-runner": "^0.20.0",
75
75
  "browser-sync": "^3.0.2",
76
76
  "jest": "^29.5.0",
77
77
  "jest-environment-jsdom": "^29.5.0",
@@ -79,7 +79,7 @@
79
79
  "ng-packagr": "^19.0.0 || ^19.2.0-next.0",
80
80
  "protractor": "^7.0.0",
81
81
  "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0",
82
- "typescript": ">=5.5 <5.8"
82
+ "typescript": ">=5.5 <5.9"
83
83
  },
84
84
  "peerDependenciesMeta": {
85
85
  "@angular/localize": {
@@ -45,8 +45,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  const private_1 = require("@angular/build/private");
47
47
  const architect_1 = require("@angular-devkit/architect");
48
- const fs = __importStar(require("fs"));
49
- const path = __importStar(require("path"));
48
+ const fs = __importStar(require("node:fs"));
49
+ const path = __importStar(require("node:path"));
50
50
  const piscina_1 = __importDefault(require("piscina"));
51
51
  const utils_1 = require("../../utils");
52
52
  const error_1 = require("../../utils/error");
@@ -46,8 +46,8 @@ const private_1 = require("@angular/build/private");
46
46
  const architect_1 = require("@angular-devkit/architect");
47
47
  const build_webpack_1 = require("@angular-devkit/build-webpack");
48
48
  const webpack_1 = require("@ngtools/webpack");
49
- const fs = __importStar(require("fs"));
50
- const path = __importStar(require("path"));
49
+ const fs = __importStar(require("node:fs"));
50
+ const path = __importStar(require("node:path"));
51
51
  const rxjs_1 = require("rxjs");
52
52
  const configs_1 = require("../../tools/webpack/configs");
53
53
  const async_chunks_1 = require("../../tools/webpack/utils/async-chunks");
@@ -73,9 +73,6 @@ function execute(options, context, transforms = {}, extensions) {
73
73
  if (transforms?.logging || transforms?.webpackConfiguration) {
74
74
  throw new Error(`The "application" and "browser-esbuild" builders do not support Webpack transforms.`);
75
75
  }
76
- if (options.allowedHosts?.length) {
77
- context.logger.warn(`The "allowedHosts" option will not be used because it is not supported by the "${builderName}" builder.`);
78
- }
79
76
  if (options.publicHost) {
80
77
  context.logger.warn(`The "publicHost" option will not be used because it is not supported by the "${builderName}" builder.`);
81
78
  }
@@ -44,9 +44,9 @@ exports.serveWebpackBrowser = serveWebpackBrowser;
44
44
  const private_1 = require("@angular/build/private");
45
45
  const build_webpack_1 = require("@angular-devkit/build-webpack");
46
46
  const core_1 = require("@angular-devkit/core");
47
- const path = __importStar(require("path"));
47
+ const path = __importStar(require("node:path"));
48
+ const url = __importStar(require("node:url"));
48
49
  const rxjs_1 = require("rxjs");
49
- const url = __importStar(require("url"));
50
50
  const configs_1 = require("../../tools/webpack/configs");
51
51
  const index_html_webpack_plugin_1 = require("../../tools/webpack/plugins/index-html-webpack-plugin");
52
52
  const service_worker_plugin_1 = require("../../tools/webpack/plugins/service-worker-plugin");
@@ -41,7 +41,7 @@ var __importStar = (this && this.__importStar) || (function () {
41
41
  })();
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.default = localizeExtractLoader;
44
- const nodePath = __importStar(require("path"));
44
+ const nodePath = __importStar(require("node:path"));
45
45
  const load_esm_1 = require("../../utils/load-esm");
46
46
  function localizeExtractLoader(content, map) {
47
47
  // This loader is not cacheable due to how message extraction works.
@@ -101,7 +101,7 @@ exports.default = (0, architect_1.createBuilder)(async (schema, context) => {
101
101
  tsConfig: options.tsConfig,
102
102
  polyfills: options.polyfills ?? ['zone.js', 'zone.js/testing'],
103
103
  outputPath: testOut,
104
- aot: false,
104
+ aot: options.aot,
105
105
  index: false,
106
106
  outputHashing: schema_1.OutputHashing.None,
107
107
  outExtension: 'mjs', // Force native ESM.
@@ -2,6 +2,10 @@
2
2
  * Jest target options
3
3
  */
4
4
  export type Schema = {
5
+ /**
6
+ * Run tests using Ahead of Time compilation.
7
+ */
8
+ aot?: boolean;
5
9
  /**
6
10
  * Globs of files to exclude, relative to the project root.
7
11
  */
@@ -32,6 +32,11 @@
32
32
  "uniqueItems": true
33
33
  },
34
34
  "default": []
35
+ },
36
+ "aot": {
37
+ "type": "boolean",
38
+ "description": "Run tests using Ahead of Time compilation.",
39
+ "default": false
35
40
  }
36
41
  },
37
42
  "additionalProperties": false,
@@ -42,7 +42,7 @@ var __importStar = (this && this.__importStar) || (function () {
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.execute = execute;
44
44
  const private_1 = require("@angular/build/private");
45
- const path = __importStar(require("path"));
45
+ const path = __importStar(require("node:path"));
46
46
  const rxjs_1 = require("rxjs");
47
47
  const configs_1 = require("../../tools/webpack/configs");
48
48
  const webpack_browser_config_1 = require("../../utils/webpack-browser-config");
@@ -116,7 +116,7 @@ async function initializeBrowser(options, context, webpackConfigurationTransform
116
116
  budgets: undefined,
117
117
  optimization: false,
118
118
  buildOptimizer: false,
119
- aot: false,
119
+ aot: options.aot,
120
120
  vendorChunk: true,
121
121
  namedChunks: true,
122
122
  extractLicenses: false,
@@ -11,9 +11,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.FindTestsPlugin = void 0;
14
- const assert_1 = __importDefault(require("assert"));
14
+ const private_1 = require("@angular/build/private");
15
15
  const mini_css_extract_plugin_1 = require("mini-css-extract-plugin");
16
- const find_tests_1 = require("./find-tests");
16
+ const node_assert_1 = __importDefault(require("node:assert"));
17
17
  /**
18
18
  * The name of the plugin provided to Webpack when tapping Webpack compiler hooks.
19
19
  */
@@ -31,7 +31,7 @@ class FindTestsPlugin {
31
31
  let originalImport;
32
32
  // Add tests files are part of the entry-point.
33
33
  webpackOptions.entry = async () => {
34
- const specFiles = await (0, find_tests_1.findTests)(include, exclude, workspaceRoot, projectSourceRoot);
34
+ const specFiles = await (0, private_1.findTests)(include, exclude, workspaceRoot, projectSourceRoot);
35
35
  const entrypoints = await entry;
36
36
  const entrypoint = entrypoints['main'];
37
37
  if (!entrypoint.import) {
@@ -42,7 +42,7 @@ class FindTestsPlugin {
42
42
  entrypoint.import = [...originalImport, ...specFiles];
43
43
  }
44
44
  else {
45
- (0, assert_1.default)(this.compilation, 'Compilation cannot be undefined.');
45
+ (0, node_assert_1.default)(this.compilation, 'Compilation cannot be undefined.');
46
46
  this.compilation
47
47
  .getLogger(mini_css_extract_plugin_1.pluginName)
48
48
  .error(`Specified patterns: "${include.join(', ')}" did not match any spec files.`);
@@ -44,9 +44,10 @@ exports.execute = execute;
44
44
  const private_1 = require("@angular/build/private");
45
45
  const architect_1 = require("@angular-devkit/architect");
46
46
  const core_1 = require("@angular-devkit/core");
47
- const module_1 = require("module");
48
- const path = __importStar(require("path"));
47
+ const node_module_1 = require("node:module");
48
+ const path = __importStar(require("node:path"));
49
49
  const rxjs_1 = require("rxjs");
50
+ const utils_1 = require("../../utils");
50
51
  const schema_1 = require("./schema");
51
52
  /**
52
53
  * @experimental Direct usage of this function is considered experimental.
@@ -56,7 +57,14 @@ function execute(options, context, transforms = {}) {
56
57
  (0, private_1.assertCompatibleAngularVersion)(context.workspaceRoot);
57
58
  return (0, rxjs_1.from)(getExecuteWithBuilder(options, context)).pipe((0, rxjs_1.mergeMap)(([useEsbuild, executeWithBuilder]) => {
58
59
  const karmaOptions = getBaseKarmaOptions(options, context, useEsbuild);
59
- return executeWithBuilder.execute(options, context, karmaOptions, transforms);
60
+ if (useEsbuild && transforms.webpackConfiguration) {
61
+ context.logger.warn(`This build is using the application builder but transforms.webpackConfiguration was provided. The transform will be ignored.`);
62
+ }
63
+ if (useEsbuild && options.fileReplacements) {
64
+ options.fileReplacements = (0, utils_1.normalizeFileReplacements)(options.fileReplacements, './');
65
+ }
66
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ return executeWithBuilder(options, context, karmaOptions, transforms);
60
68
  }));
61
69
  }
62
70
  function getBaseKarmaOptions(options, context, useEsbuild) {
@@ -101,7 +109,7 @@ function getBuiltInKarmaConfig(workspaceRoot, projectName, useEsbuild) {
101
109
  if (/[A-Z]/.test(coverageFolderName)) {
102
110
  coverageFolderName = core_1.strings.dasherize(coverageFolderName);
103
111
  }
104
- const workspaceRootRequire = (0, module_1.createRequire)(workspaceRoot + '/');
112
+ const workspaceRootRequire = (0, node_module_1.createRequire)(workspaceRoot + '/');
105
113
  // Any changes to the config here need to be synced to: packages/schematics/angular/config/files/karma.conf.js.template
106
114
  return {
107
115
  basePath: '',
@@ -141,9 +149,16 @@ function getBuiltInKarmaConfig(workspaceRoot, projectName, useEsbuild) {
141
149
  exports.default = (0, architect_1.createBuilder)(execute);
142
150
  async function getExecuteWithBuilder(options, context) {
143
151
  const useEsbuild = await checkForEsbuild(options, context);
144
- const executeWithBuilderModule = useEsbuild
145
- ? Promise.resolve().then(() => __importStar(require('./application_builder'))) : Promise.resolve().then(() => __importStar(require('./browser_builder')));
146
- return [useEsbuild, await executeWithBuilderModule];
152
+ let execute;
153
+ if (useEsbuild) {
154
+ const { executeKarmaInternal } = await Promise.resolve().then(() => __importStar(require('@angular/build/private')));
155
+ execute = executeKarmaInternal;
156
+ }
157
+ else {
158
+ const browserBuilderModule = await Promise.resolve().then(() => __importStar(require('./browser_builder')));
159
+ execute = browserBuilderModule.execute;
160
+ }
161
+ return [useEsbuild, execute];
147
162
  }
148
163
  async function checkForEsbuild(options, context) {
149
164
  if (options.builderMode !== schema_1.BuilderMode.Detect) {
@@ -2,6 +2,10 @@
2
2
  * Karma target options for Build Facade.
3
3
  */
4
4
  export type Schema = {
5
+ /**
6
+ * Run tests using Ahead of Time compilation.
7
+ */
8
+ aot?: boolean;
5
9
  /**
6
10
  * List of static application assets.
7
11
  */
@@ -276,6 +276,11 @@
276
276
  "webWorkerTsConfig": {
277
277
  "type": "string",
278
278
  "description": "TypeScript configuration for Web Worker modules."
279
+ },
280
+ "aot": {
281
+ "type": "boolean",
282
+ "description": "Run tests using Ahead of Time compilation.",
283
+ "default": false
279
284
  }
280
285
  },
281
286
  "additionalProperties": false,
@@ -46,10 +46,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.execute = execute;
47
47
  const private_1 = require("@angular/build/private");
48
48
  const architect_1 = require("@angular-devkit/architect");
49
- const fs = __importStar(require("fs"));
49
+ const fs = __importStar(require("node:fs"));
50
50
  const promises_1 = require("node:fs/promises");
51
+ const path = __importStar(require("node:path"));
51
52
  const ora_1 = __importDefault(require("ora"));
52
- const path = __importStar(require("path"));
53
53
  const piscina_1 = __importDefault(require("piscina"));
54
54
  const utils_1 = require("../../utils");
55
55
  const environment_options_1 = require("../../utils/environment-options");
@@ -43,8 +43,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.execute = execute;
44
44
  const architect_1 = require("@angular-devkit/architect");
45
45
  const core_1 = require("@angular-devkit/core");
46
- const path_1 = require("path");
47
- const url = __importStar(require("url"));
46
+ const node_path_1 = require("node:path");
47
+ const url = __importStar(require("node:url"));
48
48
  const utils_1 = require("../../utils");
49
49
  const error_1 = require("../../utils/error");
50
50
  function runProtractor(root, options) {
@@ -61,7 +61,7 @@ function runProtractor(root, options) {
61
61
  // process. To work around this we run it in a subprocess.
62
62
  // https://github.com/angular/protractor/issues/4160
63
63
  return (0, utils_1.runModuleAsObservableFork)(root, 'protractor/built/launcher', 'init', [
64
- (0, path_1.resolve)(root, options.protractorConfig),
64
+ (0, node_path_1.resolve)(root, options.protractorConfig),
65
65
  additionalProtractorConfig,
66
66
  ]).toPromise();
67
67
  }
@@ -45,9 +45,9 @@ exports.log = log;
45
45
  const private_1 = require("@angular/build/private");
46
46
  const architect_1 = require("@angular-devkit/architect");
47
47
  const core_1 = require("@angular-devkit/core");
48
- const path_1 = require("path");
48
+ const node_path_1 = require("node:path");
49
+ const url = __importStar(require("node:url"));
49
50
  const rxjs_1 = require("rxjs");
50
- const url = __importStar(require("url"));
51
51
  const utils_1 = require("./utils");
52
52
  /** Log messages to ignore and not rely to the logger */
53
53
  const IGNORED_STDOUT_MESSAGES = [
@@ -166,7 +166,7 @@ function log({ stderr, stdout }, logger) {
166
166
  }
167
167
  function startNodeServer(serverOutput, port, logger, inspectMode = false) {
168
168
  const outputPath = serverOutput.outputPath;
169
- const path = (0, path_1.join)(outputPath, 'main.js');
169
+ const path = (0, node_path_1.join)(outputPath, 'main.js');
170
170
  const env = { ...process.env, PORT: '' + port };
171
171
  const args = ['--enable-source-maps', `"${path}"`];
172
172
  if (inspectMode) {
@@ -290,8 +290,8 @@ function getSslConfig(root, options) {
290
290
  const { ssl, sslCert, sslKey } = options;
291
291
  if (ssl && sslCert && sslKey) {
292
292
  return {
293
- key: (0, path_1.resolve)(root, sslKey),
294
- cert: (0, path_1.resolve)(root, sslCert),
293
+ key: (0, node_path_1.resolve)(root, sslKey),
294
+ cert: (0, node_path_1.resolve)(root, sslCert),
295
295
  };
296
296
  }
297
297
  return ssl;
@@ -5,7 +5,7 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { SpawnOptions } from 'child_process';
8
+ import { SpawnOptions } from 'node:child_process';
9
9
  import { Observable } from 'rxjs';
10
10
  export declare function getAvailablePort(): Promise<number>;
11
11
  export declare function spawnAsObservable(command: string, args?: string[], options?: SpawnOptions): Observable<{
@@ -13,13 +13,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.getAvailablePort = getAvailablePort;
14
14
  exports.spawnAsObservable = spawnAsObservable;
15
15
  exports.waitUntilServerIsListening = waitUntilServerIsListening;
16
- const child_process_1 = require("child_process");
17
- const net_1 = require("net");
16
+ const node_child_process_1 = require("node:child_process");
17
+ const node_net_1 = require("node:net");
18
18
  const rxjs_1 = require("rxjs");
19
19
  const tree_kill_1 = __importDefault(require("tree-kill"));
20
20
  function getAvailablePort() {
21
21
  return new Promise((resolve, reject) => {
22
- const server = (0, net_1.createServer)();
22
+ const server = (0, node_net_1.createServer)();
23
23
  server
24
24
  .unref()
25
25
  .on('error', reject)
@@ -31,7 +31,7 @@ function getAvailablePort() {
31
31
  }
32
32
  function spawnAsObservable(command, args = [], options = {}) {
33
33
  return new rxjs_1.Observable((obs) => {
34
- const proc = (0, child_process_1.spawn)(command, args, options);
34
+ const proc = (0, node_child_process_1.spawn)(command, args, options);
35
35
  if (proc.stdout) {
36
36
  proc.stdout.on('data', (data) => obs.next({ stdout: data.toString() }));
37
37
  }
@@ -56,7 +56,7 @@ function spawnAsObservable(command, args = [], options = {}) {
56
56
  function waitUntilServerIsListening(port, host) {
57
57
  const allowedErrorCodes = ['ECONNREFUSED', 'ECONNRESET'];
58
58
  return new rxjs_1.Observable((obs) => {
59
- const client = (0, net_1.createConnection)({ host, port }, () => {
59
+ const client = (0, node_net_1.createConnection)({ host, port }, () => {
60
60
  obs.next(undefined);
61
61
  obs.complete();
62
62
  }).on('error', (err) => obs.error(err));
@@ -81,7 +81,7 @@ async function buildTests(testFiles, outputPath, options, ctx) {
81
81
  entryPoints,
82
82
  tsConfig: options.tsConfig,
83
83
  outputPath,
84
- aot: false,
84
+ aot: options.aot,
85
85
  index: false,
86
86
  outputHashing: schema_1.OutputHashing.None,
87
87
  optimization: false,
@@ -2,6 +2,10 @@
2
2
  * Web Test Runner target options for Build Facade.
3
3
  */
4
4
  export type Schema = {
5
+ /**
6
+ * Run tests using Ahead of Time compilation.
7
+ */
8
+ aot?: boolean;
5
9
  /**
6
10
  * List of static application assets.
7
11
  */
@@ -249,6 +249,11 @@
249
249
  "webWorkerTsConfig": {
250
250
  "type": "string",
251
251
  "description": "TypeScript configuration for Web Worker modules."
252
+ },
253
+ "aot": {
254
+ "type": "boolean",
255
+ "description": "Run tests using Ahead of Time compilation.",
256
+ "default": false
252
257
  }
253
258
  },
254
259
  "additionalProperties": false,
@@ -46,7 +46,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.getCommonConfig = getCommonConfig;
47
47
  const webpack_1 = require("@ngtools/webpack");
48
48
  const copy_webpack_plugin_1 = __importDefault(require("copy-webpack-plugin"));
49
- const path = __importStar(require("path"));
49
+ const path = __importStar(require("node:path"));
50
50
  const webpack_2 = require("webpack");
51
51
  const webpack_subresource_integrity_1 = require("webpack-subresource-integrity");
52
52
  const environment_options_1 = require("../../../utils/environment-options");
@@ -43,9 +43,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.getDevServerConfig = getDevServerConfig;
44
44
  exports.buildServePath = buildServePath;
45
45
  const core_1 = require("@angular-devkit/core");
46
- const fs_1 = require("fs");
47
- const path_1 = require("path");
48
- const url_1 = require("url");
46
+ const node_fs_1 = require("node:fs");
47
+ const node_path_1 = require("node:path");
48
+ const node_url_1 = require("node:url");
49
49
  const error_1 = require("../../../utils/error");
50
50
  const load_esm_1 = require("../../../utils/load-esm");
51
51
  const webpack_browser_config_1 = require("../../../utils/webpack-browser-config");
@@ -57,7 +57,7 @@ async function getDevServerConfig(wco) {
57
57
  if (hmr) {
58
58
  extraRules.push({
59
59
  loader: hmr_loader_1.HmrLoader,
60
- include: [(0, path_1.resolve)(wco.root, main)],
60
+ include: [(0, node_path_1.resolve)(wco.root, main)],
61
61
  });
62
62
  }
63
63
  const extraPlugins = [];
@@ -87,7 +87,7 @@ async function getDevServerConfig(wco) {
87
87
  ...headers,
88
88
  },
89
89
  historyApiFallback: !!index && {
90
- index: path_1.posix.join(servePath, (0, webpack_browser_config_1.getIndexOutputFile)(index)),
90
+ index: node_path_1.posix.join(servePath, (0, webpack_browser_config_1.getIndexOutputFile)(index)),
91
91
  disableDotRule: true,
92
92
  htmlAcceptHeaders: ['text/html', 'application/xhtml+xml'],
93
93
  rewrites: [
@@ -153,8 +153,8 @@ function getServerConfig(root, options) {
153
153
  type: 'https',
154
154
  options: sslCert && sslKey
155
155
  ? {
156
- key: (0, path_1.resolve)(root, sslKey),
157
- cert: (0, path_1.resolve)(root, sslCert),
156
+ key: (0, node_path_1.resolve)(root, sslKey),
157
+ cert: (0, node_path_1.resolve)(root, sslCert),
158
158
  }
159
159
  : undefined,
160
160
  };
@@ -167,14 +167,14 @@ async function addProxyConfig(root, proxyConfig) {
167
167
  if (!proxyConfig) {
168
168
  return undefined;
169
169
  }
170
- const proxyPath = (0, path_1.resolve)(root, proxyConfig);
171
- if (!(0, fs_1.existsSync)(proxyPath)) {
170
+ const proxyPath = (0, node_path_1.resolve)(root, proxyConfig);
171
+ if (!(0, node_fs_1.existsSync)(proxyPath)) {
172
172
  throw new Error(`Proxy configuration file ${proxyPath} does not exist.`);
173
173
  }
174
174
  let proxyConfiguration;
175
- switch ((0, path_1.extname)(proxyPath)) {
175
+ switch ((0, node_path_1.extname)(proxyPath)) {
176
176
  case '.json': {
177
- const content = await fs_1.promises.readFile(proxyPath, 'utf-8');
177
+ const content = await node_fs_1.promises.readFile(proxyPath, 'utf-8');
178
178
  const { parse, printParseErrorCode } = await Promise.resolve().then(() => __importStar(require('jsonc-parser')));
179
179
  const parseErrors = [];
180
180
  proxyConfiguration = parse(content, parseErrors, { allowTrailingComma: true });
@@ -192,7 +192,7 @@ async function addProxyConfig(root, proxyConfig) {
192
192
  // Load the ESM configuration file using the TypeScript dynamic import workaround.
193
193
  // Once TypeScript provides support for keeping the dynamic import this workaround can be
194
194
  // changed to a direct dynamic import.
195
- proxyConfiguration = (await (0, load_esm_1.loadEsmModule)((0, url_1.pathToFileURL)(proxyPath))).default;
195
+ proxyConfiguration = (await (0, load_esm_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath))).default;
196
196
  break;
197
197
  case '.cjs':
198
198
  proxyConfiguration = require(proxyPath);
@@ -211,7 +211,7 @@ async function addProxyConfig(root, proxyConfig) {
211
211
  // Load the ESM configuration file using the TypeScript dynamic import workaround.
212
212
  // Once TypeScript provides support for keeping the dynamic import this workaround can be
213
213
  // changed to a direct dynamic import.
214
- proxyConfiguration = (await (0, load_esm_1.loadEsmModule)((0, url_1.pathToFileURL)(proxyPath))).default;
214
+ proxyConfiguration = (await (0, load_esm_1.loadEsmModule)((0, node_url_1.pathToFileURL)(proxyPath))).default;
215
215
  }
216
216
  }
217
217
  return normalizeProxyConfiguration(proxyConfiguration);
@@ -288,7 +288,7 @@ function getWebSocketSettings(options, servePath) {
288
288
  client: undefined,
289
289
  };
290
290
  }
291
- const webSocketPath = path_1.posix.join(servePath, 'ng-cli-ws');
291
+ const webSocketPath = node_path_1.posix.join(servePath, 'ng-cli-ws');
292
292
  return {
293
293
  webSocketServer: {
294
294
  options: {
@@ -310,7 +310,7 @@ function getPublicHostOptions(options, webSocketPath) {
310
310
  let publicHost = options.publicHost;
311
311
  if (publicHost) {
312
312
  const hostWithProtocol = !/^\w+:\/\//.test(publicHost) ? `https://${publicHost}` : publicHost;
313
- publicHost = new url_1.URL(hostWithProtocol).host;
313
+ publicHost = new node_url_1.URL(hostWithProtocol).host;
314
314
  }
315
315
  return `auto://${publicHost || '0.0.0.0:0'}${webSocketPath}`;
316
316
  }
@@ -42,7 +42,7 @@ var __importStar = (this && this.__importStar) || (function () {
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.AnyComponentStyleBudgetChecker = void 0;
44
44
  const private_1 = require("@angular/build/private");
45
- const path = __importStar(require("path"));
45
+ const path = __importStar(require("node:path"));
46
46
  const webpack_1 = require("webpack");
47
47
  const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics");
48
48
  const PLUGIN_NAME = 'AnyComponentStyleBudgetChecker';
@@ -8,7 +8,7 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CommonJsUsageWarnPlugin = void 0;
11
- const path_1 = require("path");
11
+ const node_path_1 = require("node:path");
12
12
  const webpack_diagnostics_1 = require("../../../utils/webpack-diagnostics");
13
13
  // Webpack doesn't export these so the deep imports can potentially break.
14
14
  const AMDDefineDependency = require('webpack/lib/dependencies/AMDDefineDependency');
@@ -38,7 +38,7 @@ class CommonJsUsageWarnPlugin {
38
38
  const { dependencies, rawRequest } = module;
39
39
  if (!rawRequest ||
40
40
  rawRequest.startsWith('.') ||
41
- (0, path_1.isAbsolute)(rawRequest) ||
41
+ (0, node_path_1.isAbsolute)(rawRequest) ||
42
42
  this.allowedDependencies.has(rawRequest) ||
43
43
  this.allowedDependencies.has(this.rawRequestToPackageName(rawRequest)) ||
44
44
  rawRequest.startsWith('@angular/common/locales/')) {
@@ -9,9 +9,9 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.HmrLoader = void 0;
11
11
  exports.default = localizeExtractLoader;
12
- const path_1 = require("path");
12
+ const node_path_1 = require("node:path");
13
13
  exports.HmrLoader = __filename;
14
- const hmrAcceptPath = (0, path_1.join)(__dirname, './hmr-accept.js').replace(/\\/g, '/');
14
+ const hmrAcceptPath = (0, node_path_1.join)(__dirname, './hmr-accept.js').replace(/\\/g, '/');
15
15
  function localizeExtractLoader(content, map) {
16
16
  const source = `${content}
17
17