@angular/build 18.2.12 → 18.2.14

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": "18.2.12",
3
+ "version": "18.2.14",
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.1802.12",
26
+ "@angular-devkit/architect": "0.1802.14",
27
27
  "@babel/core": "7.25.2",
28
28
  "@babel/helper-annotate-as-pure": "7.24.7",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
@@ -45,7 +45,7 @@
45
45
  "rollup": "4.22.4",
46
46
  "sass": "1.77.6",
47
47
  "semver": "7.6.3",
48
- "vite": "5.4.6",
48
+ "vite": "5.4.14",
49
49
  "watchpack": "2.4.1"
50
50
  },
51
51
  "peerDependencies": {
@@ -44,4 +44,5 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s
44
44
  host?: string;
45
45
  port?: number;
46
46
  };
47
+ allowedHosts: true | string[];
47
48
  }>;
@@ -73,7 +73,7 @@ async function normalizeOptions(context, projectName, options) {
73
73
  }
74
74
  }
75
75
  // Initial options to keep
76
- const { host, port, poll, open, verbose, watch, liveReload, hmr, headers, proxyConfig, servePath, ssl, sslCert, sslKey, prebundle, } = options;
76
+ const { host, port, poll, open, verbose, watch, liveReload, hmr, headers, proxyConfig, servePath, ssl, sslCert, sslKey, prebundle, allowedHosts, } = options;
77
77
  // Return all the normalized options
78
78
  return {
79
79
  buildTarget,
@@ -97,5 +97,6 @@ async function normalizeOptions(context, projectName, options) {
97
97
  // Prebundling defaults to true but requires caching to function
98
98
  prebundle: cacheOptions.enabled && !optimization.scripts && prebundle,
99
99
  inspect,
100
+ allowedHosts: allowedHosts ? allowedHosts : [],
100
101
  };
101
102
  }
@@ -2,6 +2,12 @@
2
2
  * Dev Server target options for Build Facade.
3
3
  */
4
4
  export interface Schema {
5
+ /**
6
+ * The hosts that can access the development server. This option sets the Vite option of the
7
+ * same name. For further details:
8
+ * https://vite.dev/config/server-options.html#server-allowedhosts
9
+ */
10
+ allowedHosts?: AllowedHosts;
5
11
  /**
6
12
  * A build builder target to serve in the format of `project:target[:configuration]`. You
7
13
  * can also pass in more than one configuration name as a comma-separated list. Example:
@@ -78,6 +84,12 @@ export interface Schema {
78
84
  */
79
85
  watch?: boolean;
80
86
  }
87
+ /**
88
+ * The hosts that can access the development server. This option sets the Vite option of the
89
+ * same name. For further details:
90
+ * https://vite.dev/config/server-options.html#server-allowedhosts
91
+ */
92
+ export type AllowedHosts = string[] | boolean;
81
93
  /**
82
94
  * Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are
83
95
  * enabled.
@@ -36,6 +36,23 @@
36
36
  "type": "string",
37
37
  "description": "SSL certificate to use for serving HTTPS."
38
38
  },
39
+ "allowedHosts": {
40
+ "description": "The hosts that can access the development server. This option sets the Vite option of the same name. For further details: https://vite.dev/config/server-options.html#server-allowedhosts",
41
+ "default": [],
42
+ "oneOf": [
43
+ {
44
+ "type": "array",
45
+ "description": "List of hosts that are allowed to access the development server.",
46
+ "items": {
47
+ "type": "string"
48
+ }
49
+ },
50
+ {
51
+ "type": "boolean",
52
+ "description": "Indicates that all hosts are allowed. This is not recommended and a security risk."
53
+ }
54
+ ]
55
+ },
39
56
  "headers": {
40
57
  "type": "object",
41
58
  "description": "Custom HTTP headers to be added to all responses.",
@@ -411,6 +411,7 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
411
411
  strictPort: true,
412
412
  host: serverOptions.host,
413
413
  open: serverOptions.open,
414
+ allowedHosts: serverOptions.allowedHosts,
414
415
  headers: serverOptions.headers,
415
416
  proxy,
416
417
  cors: {
@@ -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 = '18.2.12';
13
+ const VERSION = '18.2.14';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&