@angular/build 19.2.2 → 19.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/build",
3
- "version": "19.2.2",
3
+ "version": "19.2.4",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,8 +23,8 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.1902.2",
27
- "@babel/core": "7.26.9",
26
+ "@angular-devkit/architect": "0.1902.4",
27
+ "@babel/core": "7.26.10",
28
28
  "@babel/helper-annotate-as-pure": "7.25.9",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
30
30
  "@babel/plugin-syntax-import-attributes": "7.26.0",
@@ -58,7 +58,7 @@
58
58
  "@angular/localize": "^19.0.0 || ^19.2.0-next.0",
59
59
  "@angular/platform-server": "^19.0.0 || ^19.2.0-next.0",
60
60
  "@angular/service-worker": "^19.0.0 || ^19.2.0-next.0",
61
- "@angular/ssr": "^19.2.2",
61
+ "@angular/ssr": "^19.2.4",
62
62
  "karma": "^6.4.0",
63
63
  "less": "^4.2.0",
64
64
  "ng-packagr": "^19.0.0 || ^19.2.0-next.0",
@@ -351,7 +351,8 @@ async function initializeApplication(options, context, karmaOptions, transforms
351
351
  // Write test files
352
352
  await writeTestFiles(buildOutput.files, buildOptions.outputPath);
353
353
  // We need to add this to the beginning *after* the testing framework has
354
- // prepended its files.
354
+ // prepended its files. The output path is required for each since they are
355
+ // added later in the test process via a plugin.
355
356
  const polyfillsFile = {
356
357
  pattern: `${outputPath}/polyfills.js`,
357
358
  included: true,
@@ -366,28 +367,29 @@ async function initializeApplication(options, context, karmaOptions, transforms
366
367
  type: 'module',
367
368
  watched: false,
368
369
  };
370
+ karmaOptions.basePath = outputPath;
369
371
  karmaOptions.files ??= [];
370
372
  if (options.scripts?.length) {
371
373
  // This should be more granular to support named bundles.
372
374
  // However, it replicates the behavior of the Karma Webpack-based builder.
373
375
  karmaOptions.files.push({
374
- pattern: `${outputPath}/scripts.js`,
376
+ pattern: `scripts.js`,
375
377
  watched: false,
376
378
  type: 'js',
377
379
  });
378
380
  }
379
381
  karmaOptions.files.push(
380
382
  // Serve global setup script.
381
- { pattern: `${outputPath}/${mainName}.js`, type: 'module', watched: false },
383
+ { pattern: `${mainName}.js`, type: 'module', watched: false },
382
384
  // Serve all source maps.
383
- { pattern: `${outputPath}/*.map`, included: false, watched: false },
385
+ { pattern: `*.map`, included: false, watched: false },
384
386
  // These are the test entrypoints.
385
- { pattern: `${outputPath}/spec-*.js`, type: 'module', watched: false });
387
+ { pattern: `spec-*.js`, type: 'module', watched: false });
386
388
  if (hasChunkOrWorkerFiles(buildOutput.files)) {
387
389
  karmaOptions.files.push(
388
390
  // Allow loading of chunk-* files but don't include them all on load.
389
391
  {
390
- pattern: `${outputPath}/{chunk,worker}-*.js`,
392
+ pattern: `{chunk,worker}-*.js`,
391
393
  type: 'module',
392
394
  included: false,
393
395
  watched: false,
@@ -395,7 +397,7 @@ async function initializeApplication(options, context, karmaOptions, transforms
395
397
  }
396
398
  if (options.styles?.length) {
397
399
  // Serve CSS outputs on page load, these are the global styles.
398
- karmaOptions.files.push({ pattern: `${outputPath}/*.css`, type: 'css', watched: false });
400
+ karmaOptions.files.push({ pattern: `*.css`, type: 'css', watched: false });
399
401
  }
400
402
  const parsedKarmaConfig = await karma.config.parseConfig(options.karmaConfig && path.resolve(context.workspaceRoot, options.karmaConfig), transforms.karmaOptions ? transforms.karmaOptions(karmaOptions) : karmaOptions, { promiseConfig: true, throwErrors: true });
401
403
  // Remove the webpack plugin/framework:
@@ -118,6 +118,9 @@ function createAngularCompilerHost(typescript, compilerOptions, hostOptions, pac
118
118
  };
119
119
  host.resourceNameToFileName = function (resourceName, containingFile) {
120
120
  const resolvedPath = node_path_1.default.join(node_path_1.default.dirname(containingFile), resourceName);
121
+ if (!this.fileExists(resolvedPath)) {
122
+ return null;
123
+ }
121
124
  // All resource names that have template file extensions are assumed to be templates
122
125
  // TODO: Update compiler to provide the resource type to avoid extension matching here.
123
126
  if (!hostOptions.externalStylesheets || hasTemplateExtension(resolvedPath)) {
@@ -430,6 +430,7 @@ function getEsBuildCommonOptions(options) {
430
430
  ...(optimizationOptions.scripts ? { 'ngDevMode': 'false' } : undefined),
431
431
  'ngJitMode': jit ? 'true' : 'false',
432
432
  'ngServerMode': 'false',
433
+ 'ngHmrMode': options.templateUpdates ? 'true' : 'false',
433
434
  },
434
435
  loader: loaderExtensions,
435
436
  footer,
@@ -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.2.2';
13
+ const VERSION = '19.2.4';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&