@angular/build 18.2.11 → 18.2.13
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 +3 -3
- package/src/builders/dev-server/options.d.ts +1 -0
- package/src/builders/dev-server/options.js +2 -1
- package/src/builders/dev-server/schema.d.ts +12 -0
- package/src/builders/dev-server/schema.json +17 -0
- package/src/builders/dev-server/vite-server.js +1 -0
- package/src/tools/esbuild/angular/compiler-plugin.js +10 -2
- package/src/tools/sass/rebasing-importer.js +1 -1
- package/src/utils/normalize-cache.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/build",
|
|
3
|
-
"version": "18.2.
|
|
3
|
+
"version": "18.2.13",
|
|
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.
|
|
26
|
+
"@angular-devkit/architect": "0.1802.13",
|
|
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.
|
|
48
|
+
"vite": "5.4.14",
|
|
49
49
|
"watchpack": "2.4.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
@@ -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: {
|
|
@@ -333,12 +333,20 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
333
333
|
};
|
|
334
334
|
});
|
|
335
335
|
build.onLoad({ filter: /\.[cm]?js$/ }, (0, load_result_cache_1.createCachedLoad)(pluginOptions.loadResultCache, async (args) => {
|
|
336
|
+
let request = args.path;
|
|
337
|
+
if (pluginOptions.fileReplacements) {
|
|
338
|
+
const replacement = pluginOptions.fileReplacements[path.normalize(args.path)];
|
|
339
|
+
if (replacement) {
|
|
340
|
+
request = path.normalize(replacement);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
336
343
|
return (0, profiling_1.profileAsync)('NG_EMIT_JS*', async () => {
|
|
337
|
-
const sideEffects = await hasSideEffects(
|
|
338
|
-
const contents = await javascriptTransformer.transformFile(
|
|
344
|
+
const sideEffects = await hasSideEffects(request);
|
|
345
|
+
const contents = await javascriptTransformer.transformFile(request, pluginOptions.jit, sideEffects);
|
|
339
346
|
return {
|
|
340
347
|
contents,
|
|
341
348
|
loader: 'js',
|
|
349
|
+
watchFiles: request !== args.path ? [request] : undefined,
|
|
342
350
|
};
|
|
343
351
|
}, true);
|
|
344
352
|
}));
|
|
@@ -65,7 +65,7 @@ class UrlRebasingImporter {
|
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
67
|
// Sass variable usage either starts with a `$` or contains a namespace and a `.$`
|
|
68
|
-
const valueNormalized = value[0] === '$' || /^\w
|
|
68
|
+
const valueNormalized = value[0] === '$' || /^\w[\w_-]*\.\$/.test(value) ? `#{${value}}` : value;
|
|
69
69
|
const rebasedPath = (0, node_path_1.relative)(this.entryDirectory, stylesheetDirectory);
|
|
70
70
|
// Normalize path separators and escape characters
|
|
71
71
|
// https://developer.mozilla.org/en-US/docs/Web/CSS/url#syntax
|
|
@@ -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.
|
|
13
|
+
const VERSION = '18.2.13';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|