@angular/build 20.3.5 → 20.3.7

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": "20.3.5",
3
+ "version": "20.3.7",
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.2003.5",
26
+ "@angular-devkit/architect": "0.2003.7",
27
27
  "@babel/core": "7.28.3",
28
28
  "@babel/helper-annotate-as-pure": "7.27.3",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
@@ -46,7 +46,7 @@
46
46
  "semver": "7.7.2",
47
47
  "source-map-support": "0.5.21",
48
48
  "tinyglobby": "0.2.14",
49
- "vite": "7.1.5",
49
+ "vite": "7.1.11",
50
50
  "watchpack": "2.4.4"
51
51
  },
52
52
  "optionalDependencies": {
@@ -60,7 +60,7 @@
60
60
  "@angular/platform-browser": "^20.0.0",
61
61
  "@angular/platform-server": "^20.0.0",
62
62
  "@angular/service-worker": "^20.0.0",
63
- "@angular/ssr": "^20.3.5",
63
+ "@angular/ssr": "^20.3.7",
64
64
  "karma": "^6.4.0",
65
65
  "less": "^4.2.0",
66
66
  "ng-packagr": "^20.0.0",
@@ -112,7 +112,7 @@
112
112
  "type": "git",
113
113
  "url": "https://github.com/angular/angular-cli.git"
114
114
  },
115
- "packageManager": "pnpm@10.18.1",
115
+ "packageManager": "pnpm@10.18.3",
116
116
  "engines": {
117
117
  "node": "^20.19.0 || ^22.12.0 || >=24.0.0",
118
118
  "npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
@@ -16,7 +16,8 @@ export type Schema = {
16
16
  */
17
17
  appShell?: boolean;
18
18
  /**
19
- * List of static application assets.
19
+ * Define the assets to be copied to the output directory. These assets are copied as-is
20
+ * without any further processing or hashing.
20
21
  */
21
22
  assets?: AssetPattern[];
22
23
  /**
@@ -126,6 +127,12 @@ export type Schema = {
126
127
  optimization?: OptimizationUnion;
127
128
  /**
128
129
  * Define the output filename cache-busting hashing mode.
130
+ *
131
+ * - `none`: No hashing.
132
+ * - `all`: Hash for all output bundles.
133
+ * - `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in
134
+ * CSS files).
135
+ * - `bundles`: Hash for output of lazy and main bundles.
129
136
  */
130
137
  outputHashing?: OutputHashing;
131
138
  /**
@@ -407,6 +414,12 @@ export type StylesClass = {
407
414
  };
408
415
  /**
409
416
  * Define the output filename cache-busting hashing mode.
417
+ *
418
+ * - `none`: No hashing.
419
+ * - `all`: Hash for all output bundles.
420
+ * - `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in
421
+ * CSS files).
422
+ * - `bundles`: Hash for output of lazy and main bundles.
410
423
  */
411
424
  export declare enum OutputHashing {
412
425
  All = "all",
@@ -48,6 +48,12 @@ var InlineStyleLanguage;
48
48
  })(InlineStyleLanguage || (exports.InlineStyleLanguage = InlineStyleLanguage = {}));
49
49
  /**
50
50
  * Define the output filename cache-busting hashing mode.
51
+ *
52
+ * - `none`: No hashing.
53
+ * - `all`: Hash for all output bundles.
54
+ * - `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in
55
+ * CSS files).
56
+ * - `bundles`: Hash for output of lazy and main bundles.
51
57
  */
52
58
  var OutputHashing;
53
59
  (function (OutputHashing) {
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "assets": {
8
8
  "type": "array",
9
- "description": "List of static application assets.",
9
+ "description": "Define the assets to be copied to the output directory. These assets are copied as-is without any further processing or hashing.",
10
10
  "default": [],
11
11
  "items": {
12
12
  "$ref": "#/definitions/assetPattern"
@@ -441,7 +441,7 @@
441
441
  },
442
442
  "outputHashing": {
443
443
  "type": "string",
444
- "description": "Define the output filename cache-busting hashing mode.",
444
+ "description": "Define the output filename cache-busting hashing mode.\n\n- `none`: No hashing.\n- `all`: Hash for all output bundles. \n- `media`: Hash for all output media (e.g., images, fonts, etc. that are referenced in CSS files).\n- `bundles`: Hash for output of lazy and main bundles.",
445
445
  "default": "none",
446
446
  "enum": ["none", "all", "media", "bundles"]
447
447
  },
@@ -667,7 +667,6 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
667
667
  }),
668
668
  },
669
669
  plugins: [
670
- (0, plugins_1.createAngularLocaleDataPlugin)(),
671
670
  (0, plugins_1.createAngularSetupMiddlewaresPlugin)({
672
671
  outputFiles,
673
672
  assets,
@@ -9,6 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.LOCALE_DATA_BASE_MODULE = exports.LOCALE_DATA_NAMESPACE = void 0;
11
11
  exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin;
12
+ const node_module_1 = require("node:module");
12
13
  /**
13
14
  * The internal namespace used by generated locale import statements and Angular locale data plugin.
14
15
  */
@@ -26,16 +27,6 @@ function createAngularLocaleDataPlugin() {
26
27
  return {
27
28
  name: 'angular-locale-data',
28
29
  setup(build) {
29
- // If packages are configured to be external then leave the original angular locale import path.
30
- // This happens when using the development server with caching enabled to allow Vite prebundling to work.
31
- // There currently is no option on the esbuild resolve function to resolve while disabling the option. To
32
- // workaround the inability to resolve the full locale location here, the Vite dev server prebundling also
33
- // contains a plugin to allow the locales to be correctly resolved when prebundling.
34
- // NOTE: If esbuild eventually allows controlling the external package options in a build.resolve call, this
35
- // workaround can be removed.
36
- if (build.initialOptions.packages === 'external') {
37
- return;
38
- }
39
30
  build.onResolve({ filter: /^angular:locale\/data:/ }, async ({ path }) => {
40
31
  // Extract the locale from the path
41
32
  const rawLocaleTag = path.split(':', 3)[2];
@@ -57,6 +48,7 @@ function createAngularLocaleDataPlugin() {
57
48
  };
58
49
  }
59
50
  let exact = true;
51
+ let localeRequire;
60
52
  while (partialLocaleTag) {
61
53
  // Angular embeds the `en`/`en-US` locale into the framework and it does not need to be included again here.
62
54
  // The onLoad hook below for the locale data namespace has an `empty` loader that will prevent inclusion.
@@ -69,11 +61,37 @@ function createAngularLocaleDataPlugin() {
69
61
  }
70
62
  // Attempt to resolve the locale tag data within the Angular base module location
71
63
  const potentialPath = `${exports.LOCALE_DATA_BASE_MODULE}/${partialLocaleTag}`;
72
- const result = await build.resolve(potentialPath, {
73
- kind: 'import-statement',
74
- resolveDir: build.initialOptions.absWorkingDir,
75
- });
76
- if (result.path) {
64
+ // If packages are configured to be external then leave the original angular locale import path.
65
+ // This happens when using the development server with caching enabled to allow Vite prebundling to work.
66
+ // There currently is no option on the esbuild resolve function to resolve while disabling the option.
67
+ // NOTE: If esbuild eventually allows controlling the external package options in a build.resolve call, this
68
+ // workaround can be removed.
69
+ let result;
70
+ const { packages, absWorkingDir } = build.initialOptions;
71
+ if (packages === 'external' && absWorkingDir) {
72
+ localeRequire ??= (0, node_module_1.createRequire)(absWorkingDir + '/');
73
+ try {
74
+ localeRequire.resolve(potentialPath);
75
+ result = {
76
+ errors: [],
77
+ warnings: [],
78
+ external: true,
79
+ sideEffects: true,
80
+ namespace: '',
81
+ suffix: '',
82
+ pluginData: undefined,
83
+ path: potentialPath,
84
+ };
85
+ }
86
+ catch { }
87
+ }
88
+ else {
89
+ result = await build.resolve(potentialPath, {
90
+ kind: 'import-statement',
91
+ resolveDir: absWorkingDir,
92
+ });
93
+ }
94
+ if (result?.path) {
77
95
  if (exact) {
78
96
  return result;
79
97
  }
@@ -6,7 +6,6 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  export { createAngularMemoryPlugin } from './angular-memory-plugin';
9
- export { createAngularLocaleDataPlugin } from './i18n-locale-plugin';
10
9
  export { createRemoveIdPrefixPlugin } from './id-prefix-plugin';
11
10
  export { createAngularSetupMiddlewaresPlugin, ServerSsrMode } from './setup-middlewares-plugin';
12
11
  export { createAngularSsrTransformPlugin } from './ssr-transform-plugin';
@@ -7,11 +7,9 @@
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.createAngularSsrTransformPlugin = exports.ServerSsrMode = exports.createAngularSetupMiddlewaresPlugin = exports.createRemoveIdPrefixPlugin = exports.createAngularLocaleDataPlugin = exports.createAngularMemoryPlugin = void 0;
10
+ exports.createAngularSsrTransformPlugin = exports.ServerSsrMode = exports.createAngularSetupMiddlewaresPlugin = exports.createRemoveIdPrefixPlugin = exports.createAngularMemoryPlugin = void 0;
11
11
  var angular_memory_plugin_1 = require("./angular-memory-plugin");
12
12
  Object.defineProperty(exports, "createAngularMemoryPlugin", { enumerable: true, get: function () { return angular_memory_plugin_1.createAngularMemoryPlugin; } });
13
- var i18n_locale_plugin_1 = require("./i18n-locale-plugin");
14
- Object.defineProperty(exports, "createAngularLocaleDataPlugin", { enumerable: true, get: function () { return i18n_locale_plugin_1.createAngularLocaleDataPlugin; } });
15
13
  var id_prefix_plugin_1 = require("./id-prefix-plugin");
16
14
  Object.defineProperty(exports, "createRemoveIdPrefixPlugin", { enumerable: true, get: function () { return id_prefix_plugin_1.createRemoveIdPrefixPlugin; } });
17
15
  var setup_middlewares_plugin_1 = require("./setup-middlewares-plugin");
@@ -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 = '20.3.5';
13
+ const VERSION = '20.3.7';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&
@@ -1,14 +0,0 @@
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 type { Plugin } from 'vite';
9
- /**
10
- * Creates a Vite plugin that resolves Angular locale data files from `@angular/common`.
11
- *
12
- * @returns A Vite plugin.
13
- */
14
- export declare function createAngularLocaleDataPlugin(): Plugin;
@@ -1,54 +0,0 @@
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
- exports.createAngularLocaleDataPlugin = createAngularLocaleDataPlugin;
11
- /**
12
- * The base module location used to search for locale specific data.
13
- */
14
- const LOCALE_DATA_BASE_MODULE = '@angular/common/locales/global';
15
- /**
16
- * Creates a Vite plugin that resolves Angular locale data files from `@angular/common`.
17
- *
18
- * @returns A Vite plugin.
19
- */
20
- function createAngularLocaleDataPlugin() {
21
- return {
22
- name: 'angular-locale-data',
23
- enforce: 'pre',
24
- async resolveId(source) {
25
- if (!source.startsWith('angular:locale/data:')) {
26
- return;
27
- }
28
- // Extract the locale from the path
29
- const originalLocale = source.split(':', 3)[2];
30
- // Remove any private subtags since these will never match
31
- let partialLocale = originalLocale.replace(/-x(-[a-zA-Z0-9]{1,8})+$/, '');
32
- let exact = true;
33
- while (partialLocale) {
34
- const potentialPath = `${LOCALE_DATA_BASE_MODULE}/${partialLocale}`;
35
- const result = await this.resolve(potentialPath);
36
- if (result) {
37
- if (!exact) {
38
- this.warn(`Locale data for '${originalLocale}' cannot be found. Using locale data for '${partialLocale}'.`);
39
- }
40
- return result;
41
- }
42
- // Remove the last subtag and try again with a less specific locale
43
- const parts = partialLocale.split('-');
44
- partialLocale = parts.slice(0, -1).join('-');
45
- exact = false;
46
- // The locales "en" and "en-US" are considered exact to retain existing behavior
47
- if (originalLocale === 'en-US' && partialLocale === 'en') {
48
- exact = true;
49
- }
50
- }
51
- return null;
52
- },
53
- };
54
- }