@angular/build 19.0.2 → 19.1.0-next.0
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 +16 -16
- package/src/builders/application/build-action.js +17 -7
- package/src/builders/application/execute-post-bundle.js +3 -3
- package/src/builders/application/options.js +15 -14
- package/src/builders/dev-server/vite-server.js +22 -26
- package/src/builders/extract-i18n/builder.js +17 -7
- package/src/tools/angular/compilation/angular-compilation.js +17 -7
- package/src/tools/angular/compilation/aot-compilation.js +13 -35
- package/src/tools/angular/compilation/factory.js +17 -7
- package/src/tools/angular/compilation/hmr-candidates.d.ts +22 -0
- package/src/tools/angular/compilation/hmr-candidates.js +238 -0
- package/src/tools/babel/plugins/pure-toplevel-functions.js +17 -7
- package/src/tools/esbuild/angular/compiler-plugin.js +33 -7
- package/src/tools/esbuild/angular/source-file-cache.d.ts +1 -1
- package/src/tools/esbuild/angular/source-file-cache.js +17 -7
- package/src/tools/esbuild/global-scripts.js +19 -8
- package/src/tools/esbuild/javascript-transformer-worker.js +17 -7
- package/src/tools/esbuild/stylesheets/less-language.js +17 -7
- package/src/tools/esbuild/stylesheets/sass-language.js +17 -7
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +17 -7
- package/src/tools/vite/plugins/ssr-transform-plugin.js +11 -15
- package/src/utils/check-port.js +17 -7
- package/src/utils/index-file/augment-index-html.js +14 -4
- package/src/utils/index-file/auto-csp.js +17 -7
- package/src/utils/index-file/inline-fonts.js +17 -7
- package/src/utils/load-proxy-config.js +17 -7
- package/src/utils/load-translations.js +17 -7
- package/src/utils/normalize-asset-patterns.js +17 -7
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/server-rendering/manifest.d.ts +3 -1
- package/src/utils/server-rendering/manifest.js +22 -10
- package/src/utils/server-rendering/prerender.js +3 -3
- package/src/utils/server-rendering/routes-extractor-worker.js +6 -1
- package/src/utils/service-worker.js +17 -7
|
@@ -0,0 +1,238 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.collectHmrCandidates = collectHmrCandidates;
|
|
14
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
|
+
const typescript_1 = __importDefault(require("typescript"));
|
|
16
|
+
/**
|
|
17
|
+
* Analyzes one or more modified files for changes to determine if any
|
|
18
|
+
* class declarations for Angular components are candidates for hot
|
|
19
|
+
* module replacement (HMR). If any source files are also modified but
|
|
20
|
+
* are not candidates then all candidates become invalid. This invalidation
|
|
21
|
+
* ensures that a full rebuild occurs and the running application stays
|
|
22
|
+
* synchronized with the code.
|
|
23
|
+
* @param modifiedFiles A set of modified files to analyze.
|
|
24
|
+
* @param param1 An Angular compiler instance
|
|
25
|
+
* @param staleSourceFiles A map of paths to previous source file instances.
|
|
26
|
+
* @returns A set of HMR candidate component class declarations.
|
|
27
|
+
*/
|
|
28
|
+
function collectHmrCandidates(modifiedFiles, { compiler }, staleSourceFiles) {
|
|
29
|
+
const candidates = new Set();
|
|
30
|
+
for (const file of modifiedFiles) {
|
|
31
|
+
// If the file is a template for component(s), add component classes as candidates
|
|
32
|
+
const templateFileNodes = compiler.getComponentsWithTemplateFile(file);
|
|
33
|
+
if (templateFileNodes.size) {
|
|
34
|
+
templateFileNodes.forEach((node) => candidates.add(node));
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
// If the file is a style for component(s), add component classes as candidates
|
|
38
|
+
const styleFileNodes = compiler.getComponentsWithStyleFile(file);
|
|
39
|
+
if (styleFileNodes.size) {
|
|
40
|
+
styleFileNodes.forEach((node) => candidates.add(node));
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const staleSource = staleSourceFiles?.get(file);
|
|
44
|
+
if (staleSource === undefined) {
|
|
45
|
+
// Unknown file requires a rebuild so clear out the candidates and stop collecting
|
|
46
|
+
candidates.clear();
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
const updatedSource = compiler.getCurrentProgram().getSourceFile(file);
|
|
50
|
+
if (updatedSource === undefined) {
|
|
51
|
+
// No longer existing program file requires a rebuild so clear out the candidates and stop collecting
|
|
52
|
+
candidates.clear();
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
// Analyze the stale and updated file for changes
|
|
56
|
+
const fileCandidates = analyzeFileUpdates(staleSource, updatedSource, compiler);
|
|
57
|
+
if (fileCandidates) {
|
|
58
|
+
fileCandidates.forEach((node) => candidates.add(node));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
// Unsupported HMR changes present
|
|
62
|
+
// Only template and style literal changes are allowed.
|
|
63
|
+
candidates.clear();
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return candidates;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Analyzes the updates of a source file for potential HMR component class candidates.
|
|
71
|
+
* A source file can contain candidates if only the Angular component metadata of a class
|
|
72
|
+
* has been changed and the metadata changes are only of supported fields.
|
|
73
|
+
* @param stale The stale (previous) source file instance.
|
|
74
|
+
* @param updated The updated source file instance.
|
|
75
|
+
* @param compiler An Angular compiler instance.
|
|
76
|
+
* @returns An array of candidate class declarations; or `null` if unsupported changes are present.
|
|
77
|
+
*/
|
|
78
|
+
function analyzeFileUpdates(stale, updated, compiler) {
|
|
79
|
+
if (stale.statements.length !== updated.statements.length) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
const candidates = [];
|
|
83
|
+
for (let i = 0; i < updated.statements.length; ++i) {
|
|
84
|
+
const updatedNode = updated.statements[i];
|
|
85
|
+
const staleNode = stale.statements[i];
|
|
86
|
+
if (typescript_1.default.isClassDeclaration(updatedNode)) {
|
|
87
|
+
if (!typescript_1.default.isClassDeclaration(staleNode)) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
// Check class declaration differences (name/heritage/modifiers)
|
|
91
|
+
if (updatedNode.name?.text !== staleNode.name?.text) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
if (!equalRangeText(updatedNode.heritageClauses, updated, staleNode.heritageClauses, stale)) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
const updatedModifiers = typescript_1.default.getModifiers(updatedNode);
|
|
98
|
+
const staleModifiers = typescript_1.default.getModifiers(staleNode);
|
|
99
|
+
if (updatedModifiers?.length !== staleModifiers?.length ||
|
|
100
|
+
!updatedModifiers?.every((updatedModifier) => staleModifiers?.some((staleModifier) => updatedModifier.kind === staleModifier.kind))) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
// Check for component class nodes
|
|
104
|
+
const meta = compiler.getMeta(updatedNode);
|
|
105
|
+
if (meta?.decorator && meta.isComponent === true) {
|
|
106
|
+
const updatedDecorators = typescript_1.default.getDecorators(updatedNode);
|
|
107
|
+
const staleDecorators = typescript_1.default.getDecorators(staleNode);
|
|
108
|
+
if (!staleDecorators || staleDecorators.length !== updatedDecorators?.length) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
// TODO: Check other decorators instead of assuming all multi-decorator components are unsupported
|
|
112
|
+
if (staleDecorators.length > 1) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
// Find index of component metadata decorator
|
|
116
|
+
const metaDecoratorIndex = updatedDecorators?.indexOf(meta.decorator);
|
|
117
|
+
(0, node_assert_1.default)(metaDecoratorIndex !== undefined, 'Component metadata decorator should always be present on component class.');
|
|
118
|
+
const updatedDecoratorExpression = meta.decorator.expression;
|
|
119
|
+
(0, node_assert_1.default)(typescript_1.default.isCallExpression(updatedDecoratorExpression) &&
|
|
120
|
+
updatedDecoratorExpression.arguments.length === 1, 'Component metadata decorator should contain a call expression with a single argument.');
|
|
121
|
+
// Check the matching stale index for the component decorator
|
|
122
|
+
const staleDecoratorExpression = staleDecorators[metaDecoratorIndex]?.expression;
|
|
123
|
+
if (!staleDecoratorExpression ||
|
|
124
|
+
!typescript_1.default.isCallExpression(staleDecoratorExpression) ||
|
|
125
|
+
staleDecoratorExpression.arguments.length !== 1) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
// Check decorator name/expression
|
|
129
|
+
// NOTE: This would typically be `Component` but can also be a property expression or some other alias.
|
|
130
|
+
// To avoid complex checks, this ensures the textual representation does not change. This has a low chance
|
|
131
|
+
// of a false positive if the expression is changed to still reference the `Component` type but has different
|
|
132
|
+
// text. However, it is rare for `Component` to not be used directly and additionally unlikely that it would
|
|
133
|
+
// be changed between edits. A false positive would also only lead to a difference of a full page reload versus
|
|
134
|
+
// an HMR update.
|
|
135
|
+
if (!equalRangeText(updatedDecoratorExpression.expression, updated, staleDecoratorExpression.expression, stale)) {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
// Compare component meta decorator object literals
|
|
139
|
+
if (hasUnsupportedMetaUpdates(staleDecoratorExpression, stale, updatedDecoratorExpression, updated)) {
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
// Compare text of the member nodes to determine if any changes have occurred
|
|
143
|
+
if (!equalRangeText(updatedNode.members, updated, staleNode.members, stale)) {
|
|
144
|
+
// A change to a member outside a component's metadata is unsupported
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
// If all previous class checks passed, this class is supported for HMR updates
|
|
148
|
+
candidates.push(updatedNode);
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// Compare text of the statement nodes to determine if any changes have occurred
|
|
153
|
+
// TODO: Consider expanding this to check semantic updates for each node kind
|
|
154
|
+
if (!equalRangeText(updatedNode, updated, staleNode, stale)) {
|
|
155
|
+
// A change to a statement outside a component's metadata is unsupported
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return candidates;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The set of Angular component metadata fields that are supported by HMR updates.
|
|
163
|
+
*/
|
|
164
|
+
const SUPPORTED_FIELDS = new Set(['template', 'templateUrl', 'styles', 'styleUrl', 'stylesUrl']);
|
|
165
|
+
/**
|
|
166
|
+
* Analyzes the metadata fields of a decorator call expression for unsupported HMR updates.
|
|
167
|
+
* Only updates to supported fields can be present for HMR to be viable.
|
|
168
|
+
* @param staleCall A call expression instance.
|
|
169
|
+
* @param staleSource The source file instance containing the stale call instance.
|
|
170
|
+
* @param updatedCall A call expression instance.
|
|
171
|
+
* @param updatedSource The source file instance containing the updated call instance.
|
|
172
|
+
* @returns true, if unsupported metadata updates are present; false, otherwise.
|
|
173
|
+
*/
|
|
174
|
+
function hasUnsupportedMetaUpdates(staleCall, staleSource, updatedCall, updatedSource) {
|
|
175
|
+
const staleObject = staleCall.arguments[0];
|
|
176
|
+
const updatedObject = updatedCall.arguments[0];
|
|
177
|
+
if (!typescript_1.default.isObjectLiteralExpression(staleObject) || !typescript_1.default.isObjectLiteralExpression(updatedObject)) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
const unsupportedFields = [];
|
|
181
|
+
for (const property of staleObject.properties) {
|
|
182
|
+
if (!typescript_1.default.isPropertyAssignment(property) || typescript_1.default.isComputedPropertyName(property.name)) {
|
|
183
|
+
// Unsupported object literal property
|
|
184
|
+
return true;
|
|
185
|
+
}
|
|
186
|
+
const name = property.name.text;
|
|
187
|
+
if (SUPPORTED_FIELDS.has(name)) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
unsupportedFields.push(property.initializer);
|
|
191
|
+
}
|
|
192
|
+
let i = 0;
|
|
193
|
+
for (const property of updatedObject.properties) {
|
|
194
|
+
if (!typescript_1.default.isPropertyAssignment(property) || typescript_1.default.isComputedPropertyName(property.name)) {
|
|
195
|
+
// Unsupported object literal property
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
const name = property.name.text;
|
|
199
|
+
if (SUPPORTED_FIELDS.has(name)) {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
// Compare in order
|
|
203
|
+
if (!equalRangeText(property.initializer, updatedSource, unsupportedFields[i++], staleSource)) {
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return i !== unsupportedFields.length;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Compares the text from a provided range in a source file to the text of a range in a second source file.
|
|
211
|
+
* The comparison avoids making any intermediate string copies.
|
|
212
|
+
* @param firstRange A text range within the first source file.
|
|
213
|
+
* @param firstSource A source file instance.
|
|
214
|
+
* @param secondRange A text range within the second source file.
|
|
215
|
+
* @param secondSource A source file instance.
|
|
216
|
+
* @returns true, if the text from both ranges is equal; false, otherwise.
|
|
217
|
+
*/
|
|
218
|
+
function equalRangeText(firstRange, firstSource, secondRange, secondSource) {
|
|
219
|
+
// Check matching undefined values
|
|
220
|
+
if (!firstRange || !secondRange) {
|
|
221
|
+
return firstRange === secondRange;
|
|
222
|
+
}
|
|
223
|
+
// Ensure lengths are equal
|
|
224
|
+
const firstLength = firstRange.end - firstRange.pos;
|
|
225
|
+
const secondLength = secondRange.end - secondRange.pos;
|
|
226
|
+
if (firstLength !== secondLength) {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
// Check each character
|
|
230
|
+
for (let i = 0; i < firstLength; ++i) {
|
|
231
|
+
const firstChar = firstSource.text.charCodeAt(i + firstRange.pos);
|
|
232
|
+
const secondChar = secondSource.text.charCodeAt(i + secondRange.pos);
|
|
233
|
+
if (firstChar !== secondChar) {
|
|
234
|
+
return false;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
44
|
};
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
44
|
};
|
|
@@ -386,6 +396,22 @@ function createCompilerPlugin(pluginOptions, stylesheetBundler) {
|
|
|
386
396
|
};
|
|
387
397
|
}, true);
|
|
388
398
|
}));
|
|
399
|
+
// Add a load handler if there are file replacement option entries for JSON files
|
|
400
|
+
if (pluginOptions.fileReplacements &&
|
|
401
|
+
Object.keys(pluginOptions.fileReplacements).some((value) => value.endsWith('.json'))) {
|
|
402
|
+
build.onLoad({ filter: /\.json$/ }, (0, load_result_cache_1.createCachedLoad)(pluginOptions.loadResultCache, async (args) => {
|
|
403
|
+
const replacement = pluginOptions.fileReplacements?.[path.normalize(args.path)];
|
|
404
|
+
if (replacement) {
|
|
405
|
+
return {
|
|
406
|
+
contents: await Promise.resolve().then(() => __importStar(require('fs/promises'))).then(({ readFile }) => readFile(path.normalize(replacement))),
|
|
407
|
+
loader: 'json',
|
|
408
|
+
watchFiles: [replacement],
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
// If no replacement defined, let esbuild handle it directly
|
|
412
|
+
return null;
|
|
413
|
+
}));
|
|
414
|
+
}
|
|
389
415
|
// Setup bundling of component templates and stylesheets when in JIT mode
|
|
390
416
|
if (pluginOptions.jit) {
|
|
391
417
|
(0, jit_plugin_callbacks_1.setupJitPluginCallbacks)(build, stylesheetBundler, additionalResults, pluginOptions.loadResultCache);
|
|
@@ -10,7 +10,7 @@ import { MemoryLoadResultCache } from '../load-result-cache';
|
|
|
10
10
|
export declare class SourceFileCache extends Map<string, ts.SourceFile> {
|
|
11
11
|
readonly persistentCachePath?: string | undefined;
|
|
12
12
|
readonly modifiedFiles: Set<string>;
|
|
13
|
-
readonly typeScriptFileCache: Map<string, string | Uint8Array
|
|
13
|
+
readonly typeScriptFileCache: Map<string, string | Uint8Array<ArrayBufferLike>>;
|
|
14
14
|
readonly loadResultCache: MemoryLoadResultCache;
|
|
15
15
|
referencedFiles?: readonly string[];
|
|
16
16
|
constructor(persistentCachePath?: string | undefined);
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
43
|
exports.SourceFileCache = void 0;
|
|
34
44
|
const node_os_1 = require("node:os");
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
44
|
};
|
|
@@ -49,7 +59,7 @@ const virtual_module_plugin_1 = require("./virtual-module-plugin");
|
|
|
49
59
|
* @returns An esbuild BuildOptions object.
|
|
50
60
|
*/
|
|
51
61
|
function createGlobalScriptsBundleOptions(options, target, initial) {
|
|
52
|
-
const { globalScripts, optimizationOptions, outputNames, preserveSymlinks, sourcemapOptions, jsonLogs, workspaceRoot, } = options;
|
|
62
|
+
const { globalScripts, optimizationOptions, outputNames, preserveSymlinks, sourcemapOptions, jsonLogs, workspaceRoot, define, } = options;
|
|
53
63
|
const namespace = 'angular:script/global';
|
|
54
64
|
const entryPoints = {};
|
|
55
65
|
let found = false;
|
|
@@ -83,6 +93,7 @@ function createGlobalScriptsBundleOptions(options, target, initial) {
|
|
|
83
93
|
platform: 'neutral',
|
|
84
94
|
target,
|
|
85
95
|
preserveSymlinks,
|
|
96
|
+
define,
|
|
86
97
|
plugins: [
|
|
87
98
|
(0, sourcemap_ignorelist_plugin_1.createSourcemapIgnorelistPlugin)(),
|
|
88
99
|
(0, virtual_module_plugin_1.createVirtualModulePlugin)({
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
44
|
};
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
43
|
exports.LessStylesheetLanguage = void 0;
|
|
34
44
|
const promises_1 = require("node:fs/promises");
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
43
|
exports.SassStylesheetLanguage = void 0;
|
|
34
44
|
exports.shutdownSassWorkerPool = shutdownSassWorkerPool;
|
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
44
|
};
|
|
@@ -17,21 +17,17 @@ async function createAngularSsrTransformPlugin(workspaceRoot) {
|
|
|
17
17
|
const { normalizePath } = await (0, load_esm_1.loadEsmModule)('vite');
|
|
18
18
|
return {
|
|
19
19
|
name: 'vite:angular-ssr-transform',
|
|
20
|
-
enforce: '
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
remappedMap
|
|
31
|
-
return {
|
|
32
|
-
...result,
|
|
33
|
-
map: remappedMap,
|
|
34
|
-
};
|
|
20
|
+
enforce: 'post',
|
|
21
|
+
transform(code, _id, { ssr, inMap } = {}) {
|
|
22
|
+
if (!ssr || !inMap) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const remappedMap = (0, remapping_1.default)([inMap], () => null);
|
|
26
|
+
// Set the sourcemap root to the workspace root. This is needed since we set a virtual path as root.
|
|
27
|
+
remappedMap.sourceRoot = normalizePath(workspaceRoot) + '/';
|
|
28
|
+
return {
|
|
29
|
+
code,
|
|
30
|
+
map: remappedMap,
|
|
35
31
|
};
|
|
36
32
|
},
|
|
37
33
|
};
|
package/src/utils/check-port.js
CHANGED
|
@@ -22,13 +22,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
22
22
|
}) : function(o, v) {
|
|
23
23
|
o["default"] = v;
|
|
24
24
|
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
32
42
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
33
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
44
|
};
|