@angular/build 19.2.0-rc.0 → 19.2.1

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.0-rc.0",
3
+ "version": "19.2.1",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,7 +23,7 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.1902.0-rc.0",
26
+ "@angular-devkit/architect": "0.1902.1",
27
27
  "@babel/core": "7.26.9",
28
28
  "@babel/helper-annotate-as-pure": "7.25.9",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
@@ -46,7 +46,7 @@
46
46
  "sass": "1.85.0",
47
47
  "semver": "7.7.1",
48
48
  "source-map-support": "0.5.21",
49
- "vite": "6.1.0",
49
+ "vite": "6.2.0",
50
50
  "watchpack": "2.4.2"
51
51
  },
52
52
  "optionalDependencies": {
@@ -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.0-rc.0",
61
+ "@angular/ssr": "^19.2.1",
62
62
  "karma": "^6.4.0",
63
63
  "less": "^4.2.0",
64
64
  "ng-packagr": "^19.0.0 || ^19.2.0-next.0",
@@ -263,8 +263,7 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa
263
263
  if (file.path.endsWith('.css')) {
264
264
  hasCssUpdates = true;
265
265
  }
266
- else if (!/(?:\.m?js|\.map)$/.test(file.path)) {
267
- // Updates to non-JS files must signal an update with the dev server
266
+ else if (!canBackgroundUpdate(file)) {
268
267
  incrementalResult.background = false;
269
268
  }
270
269
  incrementalResult.files[file.path] = {
@@ -342,3 +341,13 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa
342
341
  function isCssFilePath(filePath) {
343
342
  return /\.css(?:\.map)?$/i.test(filePath);
344
343
  }
344
+ function canBackgroundUpdate(file) {
345
+ // Files in the output root are not served and do not affect the
346
+ // application available with the development server.
347
+ if (file.type === bundler_context_1.BuildOutputFileType.Root) {
348
+ return true;
349
+ }
350
+ // Updates to non-JS files must signal an update with the dev server
351
+ // except the service worker configuration which is special cased.
352
+ return /(?:\.m?js|\.map)$/.test(file.path) || file.path === 'ngsw.json';
353
+ }
@@ -86,6 +86,13 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context
86
86
  browserOptions.security = {
87
87
  autoCsp: false,
88
88
  };
89
+ // Disable JSON build stats.
90
+ // These are not accessible with the dev server and can cause HMR fallbacks.
91
+ if (browserOptions.statsJson === true) {
92
+ context.logger.warn('Build JSON statistics output (`statsJson` option) has been disabled.' +
93
+ ' The development server does not support this option.');
94
+ }
95
+ browserOptions.statsJson = false;
89
96
  // Set all packages as external to support Vite's prebundle caching
90
97
  browserOptions.externalPackages = serverOptions.prebundle;
91
98
  // Disable generating a full manifest with routes.
@@ -24,23 +24,18 @@ const load_result_cache_1 = require("../load-result-cache");
24
24
  * For inline entries the contents will always be provided.
25
25
  */
26
26
  async function loadEntry(entry, root, skipRead) {
27
- if (entry.startsWith('file:')) {
28
- const specifier = (0, node_path_1.join)(root, entry.slice(5));
29
- return {
30
- path: specifier,
31
- contents: skipRead ? undefined : await (0, promises_1.readFile)(specifier, 'utf-8'),
32
- };
33
- }
34
- else if (entry.startsWith('inline:')) {
27
+ if (entry.startsWith('inline:')) {
35
28
  const [importer, data] = entry.slice(7).split(';', 2);
36
29
  return {
37
30
  path: (0, node_path_1.join)(root, importer),
38
31
  contents: Buffer.from(data, 'base64').toString(),
39
32
  };
40
33
  }
41
- else {
42
- throw new Error('Invalid data for Angular JIT entry.');
43
- }
34
+ const path = (0, node_path_1.join)(root, entry);
35
+ return {
36
+ path,
37
+ contents: skipRead ? undefined : await (0, promises_1.readFile)(path, 'utf-8'),
38
+ };
44
39
  }
45
40
  /**
46
41
  * Sets up esbuild resolve and load callbacks to support Angular JIT mode processing
@@ -66,7 +61,7 @@ function setupJitPluginCallbacks(build, stylesheetBundler, additionalResultFiles
66
61
  return {
67
62
  // Use a relative path to prevent fully resolved paths in the metafile (JSON stats file).
68
63
  // This is only necessary for custom namespaces. esbuild will handle the file namespace.
69
- path: 'file:' + (0, node_path_1.relative)(root, (0, node_path_1.join)((0, node_path_1.dirname)(args.importer), specifier)),
64
+ path: (0, node_path_1.relative)(root, (0, node_path_1.join)((0, node_path_1.dirname)(args.importer), specifier)),
70
65
  namespace,
71
66
  };
72
67
  }
@@ -131,7 +131,9 @@ async function compileString(data, filename, options, resolver, unsafeInlineJava
131
131
  : undefined,
132
132
  });
133
133
  return {
134
- contents: options.sourcemap ? `${css}\n${sourceMapToUrlComment(map)}` : css,
134
+ // There can be cases where `less` will return an undefined `map` even
135
+ // though the types do not specify this as a possibility.
136
+ contents: map ? `${css}\n${sourceMapToUrlComment(map)}` : css,
135
137
  loader: 'css',
136
138
  watchFiles: [filename, ...imports],
137
139
  };
@@ -183,7 +183,7 @@ class AllScriptCalculator extends Calculator {
183
183
  class AllCalculator extends Calculator {
184
184
  calculate() {
185
185
  const size = this.assets
186
- .filter((asset) => !asset.name.endsWith('.map'))
186
+ .filter((asset) => !asset.name.endsWith('.map') && !asset.componentStyle)
187
187
  .map((asset) => this.getAssetSize(asset))
188
188
  .reduce((total, size) => total + size, 0);
189
189
  return [{ size, label: 'total' }];
@@ -208,7 +208,7 @@ class AnyScriptCalculator extends Calculator {
208
208
  class AnyCalculator extends Calculator {
209
209
  calculate() {
210
210
  return this.assets
211
- .filter((asset) => !asset.name.endsWith('.map'))
211
+ .filter((asset) => !asset.name.endsWith('.map') && !asset.componentStyle)
212
212
  .map((asset) => ({
213
213
  size: this.getAssetSize(asset),
214
214
  label: asset.name,
@@ -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.0-rc.0';
13
+ const VERSION = '19.2.1';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&