@angular-devkit/build-angular 19.0.0-next.8 → 19.0.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2017 Google, Inc.
3
+ Copyright (c) 2010-2024 Google LLC. https://angular.dev/license
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
9
  copies of the Software, and to permit persons to whom the Software is
10
10
  furnished to do so, subject to the following conditions:
11
11
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
14
 
15
15
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/builders.json CHANGED
@@ -43,9 +43,14 @@
43
43
  "description": "Run unit tests with Web Test Runner."
44
44
  },
45
45
  "protractor": {
46
+ "implementation": "./src/builders/protractor-error",
47
+ "schema": "./src/builders/protractor/schema.json",
48
+ "description": "Throw an error that Protractor is end-of-life and no longer supported."
49
+ },
50
+ "private-protractor": {
46
51
  "implementation": "./src/builders/protractor",
47
52
  "schema": "./src/builders/protractor/schema.json",
48
- "description": "Run protractor over a dev server."
53
+ "description": "PRIVATE API - Do not use."
49
54
  },
50
55
  "server": {
51
56
  "implementation": "./src/builders/server",
package/package.json CHANGED
@@ -1,39 +1,37 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "19.0.0-next.8",
3
+ "version": "19.0.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.1900.0-next.8",
11
- "@angular-devkit/build-webpack": "0.1900.0-next.8",
12
- "@angular-devkit/core": "19.0.0-next.8",
13
- "@angular/build": "19.0.0-next.8",
14
- "@babel/core": "7.25.2",
15
- "@babel/generator": "7.25.6",
16
- "@babel/helper-annotate-as-pure": "7.24.7",
10
+ "@angular-devkit/architect": "0.1900.0-rc.0",
11
+ "@angular-devkit/build-webpack": "0.1900.0-rc.0",
12
+ "@angular-devkit/core": "19.0.0-rc.0",
13
+ "@angular/build": "19.0.0-rc.0",
14
+ "@babel/core": "7.26.0",
15
+ "@babel/generator": "7.26.0",
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.4",
19
- "@babel/plugin-transform-async-to-generator": "7.24.7",
20
- "@babel/plugin-transform-runtime": "7.25.4",
21
- "@babel/preset-env": "7.25.4",
22
- "@babel/runtime": "7.25.6",
23
- "@discoveryjs/json-ext": "0.6.1",
24
- "@ngtools/webpack": "19.0.0-next.8",
18
+ "@babel/plugin-transform-async-generator-functions": "7.25.9",
19
+ "@babel/plugin-transform-async-to-generator": "7.25.9",
20
+ "@babel/plugin-transform-runtime": "7.25.9",
21
+ "@babel/preset-env": "7.26.0",
22
+ "@babel/runtime": "7.26.0",
23
+ "@discoveryjs/json-ext": "0.6.3",
24
+ "@ngtools/webpack": "19.0.0-rc.0",
25
25
  "@vitejs/plugin-basic-ssl": "1.1.0",
26
26
  "ansi-colors": "4.1.3",
27
27
  "autoprefixer": "10.4.20",
28
28
  "babel-loader": "9.2.1",
29
29
  "browserslist": "^4.21.5",
30
30
  "copy-webpack-plugin": "12.0.2",
31
- "critters": "0.0.24",
32
31
  "css-loader": "7.1.2",
33
32
  "esbuild-wasm": "0.24.0",
34
33
  "fast-glob": "3.3.2",
35
- "http-proxy-middleware": "3.0.2",
36
- "https-proxy-agent": "7.0.5",
34
+ "http-proxy-middleware": "3.0.3",
37
35
  "istanbul-lib-instrument": "6.0.3",
38
36
  "jsonc-parser": "3.3.1",
39
37
  "karma-source-map-support": "1.4.0",
@@ -41,29 +39,24 @@
41
39
  "less-loader": "12.2.0",
42
40
  "license-webpack-plugin": "4.0.2",
43
41
  "loader-utils": "3.3.1",
44
- "magic-string": "0.30.11",
45
42
  "mini-css-extract-plugin": "2.9.1",
46
- "mrmime": "2.0.0",
47
43
  "open": "10.1.0",
48
44
  "ora": "5.4.1",
49
- "parse5-html-rewriting-stream": "7.0.0",
50
45
  "picomatch": "4.0.2",
51
46
  "piscina": "4.7.0",
52
47
  "postcss": "8.4.47",
53
48
  "postcss-loader": "8.1.1",
54
49
  "resolve-url-loader": "5.0.0",
55
50
  "rxjs": "7.8.1",
56
- "sass": "1.79.3",
51
+ "sass": "1.80.5",
57
52
  "sass-loader": "16.0.2",
58
53
  "semver": "7.6.3",
59
54
  "source-map-loader": "5.0.0",
60
55
  "source-map-support": "0.5.21",
61
- "terser": "5.33.0",
56
+ "terser": "5.36.0",
62
57
  "tree-kill": "1.2.2",
63
- "tslib": "2.7.0",
64
- "vite": "5.4.8",
65
- "watchpack": "2.4.2",
66
- "webpack": "5.94.0",
58
+ "tslib": "2.8.0",
59
+ "webpack": "5.95.0",
67
60
  "webpack-dev-middleware": "7.4.2",
68
61
  "webpack-dev-server": "5.1.0",
69
62
  "webpack-merge": "6.0.1",
@@ -77,7 +70,7 @@
77
70
  "@angular/localize": "^19.0.0-next.0",
78
71
  "@angular/platform-server": "^19.0.0-next.0",
79
72
  "@angular/service-worker": "^19.0.0-next.0",
80
- "@angular/ssr": "^19.0.0-next.8",
73
+ "@angular/ssr": "^19.0.0-rc.0",
81
74
  "@web/test-runner": "^0.19.0",
82
75
  "browser-sync": "^3.0.2",
83
76
  "jest": "^29.5.0",
@@ -31,9 +31,11 @@ async function extractMessages(options, builderName, context, extractorConstruct
31
31
  buildOptions.budgets = undefined;
32
32
  buildOptions.index = false;
33
33
  buildOptions.serviceWorker = false;
34
+ buildOptions.server = undefined;
34
35
  buildOptions.ssr = false;
35
- buildOptions.appShell = false;
36
- buildOptions.prerender = false;
36
+ buildOptions.appShell = undefined;
37
+ buildOptions.prerender = undefined;
38
+ buildOptions.outputMode = undefined;
37
39
  const builderResult = await first((0, private_1.buildApplicationInternal)(buildOptions, context));
38
40
  let success = false;
39
41
  if (!builderResult || builderResult.kind === private_1.ResultKind.Failure) {
@@ -29,16 +29,19 @@ var __importStar = (this && this.__importStar) || function (mod) {
29
29
  __setModuleDefault(result, mod);
30
30
  return result;
31
31
  };
32
+ var __importDefault = (this && this.__importDefault) || function (mod) {
33
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
+ };
32
35
  Object.defineProperty(exports, "__esModule", { value: true });
33
36
  exports.execute = execute;
34
37
  exports.writeTestFiles = writeTestFiles;
35
38
  const build_1 = require("@angular/build");
36
39
  const private_1 = require("@angular/build/private");
37
40
  const crypto_1 = require("crypto");
41
+ const fast_glob_1 = __importDefault(require("fast-glob"));
38
42
  const fs = __importStar(require("fs/promises"));
39
43
  const path = __importStar(require("path"));
40
44
  const rxjs_1 = require("rxjs");
41
- const read_tsconfig_1 = require("../../utils/read-tsconfig");
42
45
  const schema_1 = require("../browser-esbuild/schema");
43
46
  const find_tests_1 = require("./find-tests");
44
47
  class ApplicationBuildError extends Error {
@@ -47,8 +50,58 @@ class ApplicationBuildError extends Error {
47
50
  this.name = 'ApplicationBuildError';
48
51
  }
49
52
  }
53
+ function injectKarmaReporter(context, buildOptions, karmaConfig, subscriber) {
54
+ const reporterName = 'angular-progress-notifier';
55
+ class ProgressNotifierReporter {
56
+ emitter;
57
+ static $inject = ['emitter'];
58
+ constructor(emitter) {
59
+ this.emitter = emitter;
60
+ this.startWatchingBuild();
61
+ }
62
+ startWatchingBuild() {
63
+ void (async () => {
64
+ for await (const buildOutput of (0, private_1.buildApplicationInternal)({
65
+ ...buildOptions,
66
+ watch: true,
67
+ }, context)) {
68
+ if (buildOutput.kind === private_1.ResultKind.Failure) {
69
+ subscriber.next({ success: false, message: 'Build failed' });
70
+ }
71
+ else if (buildOutput.kind === private_1.ResultKind.Incremental ||
72
+ buildOutput.kind === private_1.ResultKind.Full) {
73
+ await writeTestFiles(buildOutput.files, buildOptions.outputPath);
74
+ this.emitter.refreshFiles();
75
+ }
76
+ }
77
+ })();
78
+ }
79
+ onRunComplete = function (_browsers, results) {
80
+ if (results.exitCode === 0) {
81
+ subscriber.next({ success: true });
82
+ }
83
+ else {
84
+ subscriber.next({ success: false });
85
+ }
86
+ };
87
+ }
88
+ karmaConfig.reporters ??= [];
89
+ karmaConfig.reporters.push(reporterName);
90
+ karmaConfig.plugins ??= [];
91
+ karmaConfig.plugins.push({
92
+ [`reporter:${reporterName}`]: [
93
+ 'factory',
94
+ Object.assign((...args) => new ProgressNotifierReporter(...args), ProgressNotifierReporter),
95
+ ],
96
+ });
97
+ }
50
98
  function execute(options, context, karmaOptions, transforms = {}) {
51
- return (0, rxjs_1.from)(initializeApplication(options, context, karmaOptions, transforms)).pipe((0, rxjs_1.switchMap)(([karma, karmaConfig]) => new rxjs_1.Observable((subscriber) => {
99
+ return (0, rxjs_1.from)(initializeApplication(options, context, karmaOptions, transforms)).pipe((0, rxjs_1.switchMap)(([karma, karmaConfig, buildOptions]) => new rxjs_1.Observable((subscriber) => {
100
+ // If `--watch` is explicitly enabled or if we are keeping the Karma
101
+ // process running, we should hook Karma into the build.
102
+ if (options.watch ?? !karmaConfig.singleRun) {
103
+ injectKarmaReporter(context, buildOptions, karmaConfig, subscriber);
104
+ }
52
105
  // Complete the observable once the Karma server returns.
53
106
  const karmaServer = new karma.Server(karmaConfig, (exitCode) => {
54
107
  subscriber.next({ success: exitCode === 0 });
@@ -76,41 +129,40 @@ async function getProjectSourceRoot(context) {
76
129
  const sourceRoot = (projectMetadata.sourceRoot ?? projectMetadata.root ?? '');
77
130
  return path.join(context.workspaceRoot, sourceRoot);
78
131
  }
79
- async function collectEntrypoints(options, context) {
80
- const projectSourceRoot = await getProjectSourceRoot(context);
132
+ function normalizePolyfills(polyfills) {
133
+ if (typeof polyfills === 'string') {
134
+ return [polyfills];
135
+ }
136
+ return polyfills ?? [];
137
+ }
138
+ async function collectEntrypoints(options, context, projectSourceRoot) {
81
139
  // Glob for files to test.
82
140
  const testFiles = await (0, find_tests_1.findTests)(options.include ?? [], options.exclude ?? [], context.workspaceRoot, projectSourceRoot);
83
- const entryPoints = new Set([
84
- ...testFiles,
85
- '@angular-devkit/build-angular/src/builders/karma/init_test_bed.js',
86
- ]);
87
- // Extract `zone.js/testing` to a separate entry point because it needs to be loaded after Jasmine.
88
- const [polyfills, hasZoneTesting] = extractZoneTesting(options.polyfills);
89
- if (hasZoneTesting) {
90
- entryPoints.add('zone.js/testing');
91
- }
92
- const tsConfigPath = path.resolve(context.workspaceRoot, options.tsConfig);
93
- const tsConfig = await (0, read_tsconfig_1.readTsconfig)(tsConfigPath);
94
- const localizePackageInitEntryPoint = '@angular/localize/init';
95
- const hasLocalizeType = tsConfig.options.types?.some((t) => t === '@angular/localize' || t === localizePackageInitEntryPoint);
96
- if (hasLocalizeType) {
97
- polyfills.push(localizePackageInitEntryPoint);
98
- }
99
- return [entryPoints, polyfills];
141
+ return new Set(testFiles);
100
142
  }
101
143
  async function initializeApplication(options, context, karmaOptions, transforms = {}) {
102
144
  if (transforms.webpackConfiguration) {
103
145
  context.logger.warn(`This build is using the application builder but transforms.webpackConfiguration was provided. The transform will be ignored.`);
104
146
  }
105
- const testDir = path.join(context.workspaceRoot, 'dist/test-out', (0, crypto_1.randomUUID)());
106
- const [karma, [entryPoints, polyfills]] = await Promise.all([
147
+ const outputPath = path.join(context.workspaceRoot, 'dist/test-out', (0, crypto_1.randomUUID)());
148
+ const projectSourceRoot = await getProjectSourceRoot(context);
149
+ const [karma, entryPoints] = await Promise.all([
107
150
  Promise.resolve().then(() => __importStar(require('karma'))),
108
- collectEntrypoints(options, context),
109
- fs.rm(testDir, { recursive: true, force: true }),
151
+ collectEntrypoints(options, context, projectSourceRoot),
152
+ fs.rm(outputPath, { recursive: true, force: true }),
110
153
  ]);
111
- const outputPath = testDir;
112
- // Build tests with `application` builder, using test files as entry points.
113
- const buildOutput = await first((0, private_1.buildApplicationInternal)({
154
+ let mainName = 'init_test_bed';
155
+ if (options.main) {
156
+ entryPoints.add(options.main);
157
+ mainName = path.basename(options.main, path.extname(options.main));
158
+ }
159
+ else {
160
+ entryPoints.add('@angular-devkit/build-angular/src/builders/karma/init_test_bed.js');
161
+ }
162
+ const instrumentForCoverage = options.codeCoverage
163
+ ? createInstrumentationFilter(projectSourceRoot, getInstrumentationExcludedPaths(context.workspaceRoot, options.codeCoverageExclude ?? []))
164
+ : undefined;
165
+ const buildOptions = {
114
166
  entryPoints,
115
167
  tsConfig: options.tsConfig,
116
168
  outputPath,
@@ -123,10 +175,13 @@ async function initializeApplication(options, context, karmaOptions, transforms
123
175
  styles: true,
124
176
  vendor: true,
125
177
  },
178
+ instrumentForCoverage,
126
179
  styles: options.styles,
127
- polyfills,
180
+ polyfills: normalizePolyfills(options.polyfills),
128
181
  webWorkerTsConfig: options.webWorkerTsConfig,
129
- }, context));
182
+ };
183
+ // Build tests with `application` builder, using test files as entry points.
184
+ const buildOutput = await first((0, private_1.buildApplicationInternal)(buildOptions, context));
130
185
  if (buildOutput.kind === private_1.ResultKind.Failure) {
131
186
  throw new ApplicationBuildError('Build failed');
132
187
  }
@@ -134,22 +189,26 @@ async function initializeApplication(options, context, karmaOptions, transforms
134
189
  throw new ApplicationBuildError('A full build result is required from the application builder.');
135
190
  }
136
191
  // Write test files
137
- await writeTestFiles(buildOutput.files, testDir);
192
+ await writeTestFiles(buildOutput.files, buildOptions.outputPath);
138
193
  karmaOptions.files ??= [];
139
194
  karmaOptions.files.push(
140
195
  // Serve polyfills first.
141
- { pattern: `${testDir}/polyfills.js`, type: 'module' },
142
- // Allow loading of chunk-* files but don't include them all on load.
143
- { pattern: `${testDir}/chunk-*.js`, type: 'module', included: false },
144
- // Allow loading of worker-* files but don't include them all on load.
145
- { pattern: `${testDir}/worker-*.js`, type: 'module', included: false },
146
- // `zone.js/testing`, served but not included on page load.
147
- { pattern: `${testDir}/testing.js`, type: 'module', included: false },
196
+ { pattern: `${outputPath}/polyfills.js`, type: 'module' },
197
+ // Serve global setup script.
198
+ { pattern: `${outputPath}/${mainName}.js`, type: 'module' },
199
+ // Serve all source maps.
200
+ { pattern: `${outputPath}/*.map`, included: false });
201
+ if (hasChunkOrWorkerFiles(buildOutput.files)) {
202
+ karmaOptions.files.push(
203
+ // Allow loading of chunk-* files but don't include them all on load.
204
+ { pattern: `${outputPath}/{chunk,worker}-*.js`, type: 'module', included: false });
205
+ }
206
+ karmaOptions.files.push(
148
207
  // Serve remaining JS on page load, these are the test entrypoints.
149
- { pattern: `${testDir}/*.js`, type: 'module' });
208
+ { pattern: `${outputPath}/*.js`, type: 'module' });
150
209
  if (options.styles?.length) {
151
210
  // Serve CSS outputs on page load, these are the global styles.
152
- karmaOptions.files.push({ pattern: `${testDir}/*.css`, type: 'css' });
211
+ karmaOptions.files.push({ pattern: `${outputPath}/*.css`, type: 'css' });
153
212
  }
154
213
  const parsedKarmaConfig = await karma.config.parseConfig(options.karmaConfig && path.resolve(context.workspaceRoot, options.karmaConfig), transforms.karmaOptions ? transforms.karmaOptions(karmaOptions) : karmaOptions, { promiseConfig: true, throwErrors: true });
155
214
  // Remove the webpack plugin/framework:
@@ -173,7 +232,12 @@ async function initializeApplication(options, context, karmaOptions, transforms
173
232
  !parsedKarmaConfig.reporters?.some((r) => r === 'coverage' || r === 'coverage-istanbul')) {
174
233
  parsedKarmaConfig.reporters = (parsedKarmaConfig.reporters ?? []).concat(['coverage']);
175
234
  }
176
- return [karma, parsedKarmaConfig];
235
+ return [karma, parsedKarmaConfig, buildOptions];
236
+ }
237
+ function hasChunkOrWorkerFiles(files) {
238
+ return Object.keys(files).some((filename) => {
239
+ return /(?:^|\/)(?:worker|chunk)[^/]+\.js$/.test(filename);
240
+ });
177
241
  }
178
242
  async function writeTestFiles(files, testDir) {
179
243
  const directoryExists = new Set();
@@ -199,15 +263,6 @@ async function writeTestFiles(files, testDir) {
199
263
  }
200
264
  });
201
265
  }
202
- function extractZoneTesting(polyfills) {
203
- if (typeof polyfills === 'string') {
204
- polyfills = [polyfills];
205
- }
206
- polyfills ??= [];
207
- const polyfillsWithoutZoneTesting = polyfills.filter((polyfill) => polyfill !== 'zone.js/testing');
208
- const hasZoneTesting = polyfills.length !== polyfillsWithoutZoneTesting.length;
209
- return [polyfillsWithoutZoneTesting, hasZoneTesting];
210
- }
211
266
  /** Returns the first item yielded by the given generator and cancels the execution. */
212
267
  async function first(generator) {
213
268
  for await (const value of generator) {
@@ -215,3 +270,18 @@ async function first(generator) {
215
270
  }
216
271
  throw new Error('Expected generator to emit at least once.');
217
272
  }
273
+ function createInstrumentationFilter(includedBasePath, excludedPaths) {
274
+ return (request) => {
275
+ return (!excludedPaths.has(request) &&
276
+ !/\.(e2e|spec)\.tsx?$|[\\/]node_modules[\\/]/.test(request) &&
277
+ request.startsWith(includedBasePath));
278
+ };
279
+ }
280
+ function getInstrumentationExcludedPaths(root, excludedPaths) {
281
+ const excluded = new Set();
282
+ for (const excludeGlob of excludedPaths) {
283
+ const excludePath = excludeGlob[0] === '/' ? excludeGlob.slice(1) : excludeGlob;
284
+ fast_glob_1.default.sync(excludePath, { cwd: root }).forEach((p) => excluded.add(path.join(root, p)));
285
+ }
286
+ return excluded;
287
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { Schema as ProtractorBuilderOptions } from '../protractor/schema';
9
+ declare const _default: import("../../../../architect/src/internal").Builder<ProtractorBuilderOptions & import("../../../../core/src").JsonObject>;
10
+ export default _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ const architect_1 = require("@angular-devkit/architect");
11
+ exports.default = (0, architect_1.createBuilder)((_options, context) => {
12
+ context.logger.error('Protractor has reached end-of-life and is no longer supported. For additional information and alternatives, please see https://blog.angular.dev/protractor-deprecation-update-august-2023-2beac7402ce0.');
13
+ return { success: false };
14
+ });
@@ -20,14 +20,6 @@ const load_esm_1 = require("../../../utils/load-esm");
20
20
  * Cached instance of the compiler-cli linker's needsLinking function.
21
21
  */
22
22
  let needsLinking;
23
- /**
24
- * List of browsers which are affected by a WebKit bug where class field
25
- * initializers might have incorrect variable scopes.
26
- *
27
- * See: https://github.com/angular/angular-cli/issues/24355#issuecomment-1333477033
28
- * See: https://github.com/WebKit/WebKit/commit/e8788a34b3d5f5b4edd7ff6450b80936bff396f2
29
- */
30
- let safariClassFieldScopeBugBrowsers;
31
23
  function createI18nDiagnostics(reporter) {
32
24
  const diagnostics = new (class {
33
25
  messages = [];
@@ -109,29 +101,12 @@ function default_1(api, options) {
109
101
  // However, this doesn't effect libraries and hence we use preset-env to downlevel ES features
110
102
  // based on the supported browsers in browserslist.
111
103
  if (options.supportedBrowsers) {
112
- const includePlugins = [];
113
- if (safariClassFieldScopeBugBrowsers === undefined) {
114
- const browserslist = require('browserslist');
115
- safariClassFieldScopeBugBrowsers = new Set(browserslist([
116
- // Safari <15 is technically not supported via https://angular.dev/reference/versions#browser-support
117
- // but we apply the workaround if forcibly selected.
118
- 'Safari <=15',
119
- 'iOS <=15',
120
- ]));
121
- }
122
- // If a Safari browser affected by the class field scope bug is selected, we
123
- // downlevel class properties by ensuring the class properties Babel plugin
124
- // is always included- regardless of the preset-env targets.
125
- if (options.supportedBrowsers.some((b) => safariClassFieldScopeBugBrowsers.has(b))) {
126
- includePlugins.push('@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-private-methods');
127
- }
128
104
  presets.push([
129
105
  require('@babel/preset-env').default,
130
106
  {
131
107
  bugfixes: true,
132
108
  modules: false,
133
109
  targets: options.supportedBrowsers,
134
- include: includePlugins,
135
110
  exclude: ['transform-typeof-symbol'],
136
111
  },
137
112
  ]);
@@ -231,7 +231,10 @@ async function getCommonConfig(wco) {
231
231
  const extraMinimizers = [];
232
232
  if (scriptsOptimization) {
233
233
  extraMinimizers.push(new plugins_1.JavaScriptOptimizerPlugin({
234
- define: buildOptions.aot ? GLOBAL_DEFS_FOR_TERSER_WITH_AOT : GLOBAL_DEFS_FOR_TERSER,
234
+ define: {
235
+ ...(buildOptions.aot ? GLOBAL_DEFS_FOR_TERSER_WITH_AOT : GLOBAL_DEFS_FOR_TERSER),
236
+ 'ngServerMode': isPlatformServer,
237
+ },
235
238
  sourcemap: scriptsSourceMap,
236
239
  supportedBrowsers: buildOptions.supportedBrowsers,
237
240
  keepIdentifierNames: !environment_options_1.allowMangle || isPlatformServer,
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.normalizeCacheOptions = normalizeCacheOptions;
11
11
  const node_path_1 = require("node:path");
12
12
  /** Version placeholder is replaced during the build process with actual package version */
13
- const VERSION = '19.0.0-next.8';
13
+ const VERSION = '19.0.0-rc.0';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&
@@ -273,11 +273,6 @@ function unwrapTemplateLiteral(path, utils) {
273
273
  const [expressions] = utils.unwrapExpressionsFromTemplateLiteral(path.get('quasi'));
274
274
  return [messageParts, expressions];
275
275
  }
276
- function unwrapLocalizeCall(path, utils) {
277
- const [messageParts] = utils.unwrapMessagePartsFromLocalizeCall(path);
278
- const [expressions] = utils.unwrapSubstitutionsFromLocalizeCall(path);
279
- return [messageParts, expressions];
280
- }
281
276
  async function loadLocaleData(path, optimize) {
282
277
  // The path is validated during option processing before the build starts
283
278
  const content = await fs.readFile(path, 'utf8');
@@ -22,7 +22,7 @@ async function findTailwindConfigurationFile(workspaceRoot, projectRoot) {
22
22
  files: new Set(entries),
23
23
  })));
24
24
  // A configuration file can exist in the project or workspace root
25
- for await (const { root, files } of dirEntries) {
25
+ for (const { root, files } of await Promise.all(dirEntries)) {
26
26
  for (const potentialConfig of tailwindConfigFiles) {
27
27
  if (files.has(potentialConfig)) {
28
28
  return (0, node_path_1.join)(root, potentialConfig);