@angular/build 19.0.0-next.0 → 19.0.0-next.10
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/LICENSE +5 -5
- package/package.json +20 -16
- package/src/builders/application/build-action.js +9 -9
- package/src/builders/application/chunk-optimizer.js +1 -4
- package/src/builders/application/execute-build.js +19 -2
- package/src/builders/application/execute-post-bundle.d.ts +2 -2
- package/src/builders/application/execute-post-bundle.js +58 -20
- package/src/builders/application/i18n.d.ts +2 -2
- package/src/builders/application/i18n.js +6 -16
- package/src/builders/application/index.js +8 -5
- package/src/builders/application/options.d.ts +36 -1
- package/src/builders/application/options.js +60 -3
- package/src/builders/application/schema.d.ts +15 -0
- package/src/builders/application/schema.js +11 -1
- package/src/builders/application/schema.json +5 -0
- package/src/builders/application/setup-bundling.js +12 -9
- package/src/builders/dev-server/internal.d.ts +0 -1
- package/src/builders/dev-server/internal.js +1 -3
- package/src/builders/dev-server/vite-server.d.ts +8 -2
- package/src/builders/dev-server/vite-server.js +111 -56
- package/src/builders/extract-i18n/application-extraction.js +7 -3
- package/src/tools/angular/angular-host.d.ts +2 -1
- package/src/tools/angular/angular-host.js +20 -1
- package/src/tools/angular/compilation/angular-compilation.d.ts +1 -0
- package/src/tools/angular/compilation/aot-compilation.d.ts +1 -0
- package/src/tools/angular/compilation/aot-compilation.js +9 -1
- package/src/tools/angular/compilation/jit-compilation.js +2 -1
- package/src/tools/angular/compilation/parallel-compilation.d.ts +2 -1
- package/src/tools/angular/compilation/parallel-compilation.js +2 -10
- package/src/tools/angular/compilation/parallel-worker.d.ts +1 -0
- package/src/tools/angular/compilation/parallel-worker.js +2 -1
- package/src/tools/babel/plugins/add-code-coverage.d.ts +14 -0
- package/src/tools/babel/plugins/add-code-coverage.js +44 -0
- package/src/tools/babel/plugins/types.d.ts +20 -0
- package/src/tools/esbuild/angular/compiler-plugin.d.ts +2 -0
- package/src/tools/esbuild/angular/compiler-plugin.js +46 -4
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +8 -3
- package/src/tools/esbuild/angular/component-stylesheets.js +46 -11
- package/src/tools/esbuild/angular/file-reference-tracker.d.ts +1 -1
- package/src/tools/esbuild/application-code-bundle.d.ts +2 -6
- package/src/tools/esbuild/application-code-bundle.js +208 -92
- package/src/tools/esbuild/budget-stats.js +1 -1
- package/src/tools/esbuild/bundler-context.d.ts +4 -3
- package/src/tools/esbuild/bundler-context.js +21 -13
- package/src/tools/esbuild/bundler-execution-result.d.ts +5 -2
- package/src/tools/esbuild/bundler-execution-result.js +7 -3
- package/src/tools/esbuild/cache.d.ts +6 -1
- package/src/tools/esbuild/cache.js +7 -0
- package/src/tools/esbuild/compiler-plugin-options.js +3 -1
- package/src/tools/esbuild/i18n-inliner.js +4 -4
- package/src/tools/esbuild/javascript-transformer-worker.d.ts +1 -0
- package/src/tools/esbuild/javascript-transformer-worker.js +5 -1
- package/src/tools/esbuild/javascript-transformer.d.ts +2 -2
- package/src/tools/esbuild/javascript-transformer.js +7 -12
- package/src/tools/esbuild/utils.d.ts +9 -0
- package/src/tools/esbuild/utils.js +21 -3
- package/src/tools/sass/sass-service.js +11 -13
- package/src/tools/sass/worker.d.ts +13 -32
- package/src/tools/sass/worker.js +1 -0
- package/src/tools/vite/middlewares/assets-middleware.d.ts +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js +43 -4
- package/src/tools/vite/middlewares/headers-middleware.d.ts +19 -0
- package/src/tools/vite/middlewares/headers-middleware.js +34 -0
- package/src/tools/vite/middlewares/html-fallback-middleware.d.ts +1 -1
- package/src/tools/vite/middlewares/html-fallback-middleware.js +23 -7
- package/src/tools/vite/middlewares/index-html-middleware.js +1 -2
- package/src/tools/vite/middlewares/index.d.ts +2 -1
- package/src/tools/vite/middlewares/index.js +5 -2
- package/src/tools/vite/middlewares/ssr-middleware.d.ts +2 -4
- package/src/tools/vite/middlewares/ssr-middleware.js +75 -43
- package/src/tools/vite/plugins/angular-memory-plugin.d.ts +16 -0
- package/src/tools/vite/{angular-memory-plugin.js → plugins/angular-memory-plugin.js} +19 -40
- package/src/tools/vite/{i18n-locale-plugin.d.ts → plugins/i18n-locale-plugin.d.ts} +0 -4
- package/src/tools/vite/{i18n-locale-plugin.js → plugins/i18n-locale-plugin.js} +2 -3
- package/src/tools/vite/plugins/index.d.ts +12 -0
- package/src/tools/vite/plugins/index.js +21 -0
- package/src/tools/vite/plugins/setup-middlewares-plugin.d.ts +41 -0
- package/src/tools/vite/plugins/setup-middlewares-plugin.js +62 -0
- package/src/{utils/server-rendering/main-bundle-exports.js → tools/vite/plugins/ssr-transform-plugin.d.ts} +2 -2
- package/src/tools/vite/plugins/ssr-transform-plugin.js +38 -0
- package/src/tools/vite/utils.d.ts +0 -3
- package/src/tools/vite/utils.js +0 -12
- package/src/typings.d.ts +26 -0
- package/src/utils/environment-options.d.ts +2 -0
- package/src/utils/environment-options.js +5 -1
- package/src/utils/index-file/index-html-generator.js +5 -0
- package/src/utils/index-file/inline-critical-css.js +43 -33
- package/src/utils/index-file/ngcm-attribute.d.ts +15 -0
- package/src/utils/index-file/ngcm-attribute.js +37 -0
- package/src/utils/index-file/valid-self-closing-tags.js +28 -0
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/server-rendering/fetch-patch.d.ts +1 -1
- package/src/utils/server-rendering/fetch-patch.js +5 -6
- package/src/utils/server-rendering/launch-server.d.ts +14 -0
- package/src/utils/server-rendering/launch-server.js +63 -0
- package/src/utils/server-rendering/load-esm-from-memory.d.ts +18 -2
- package/src/utils/server-rendering/manifest.d.ts +50 -0
- package/src/utils/server-rendering/manifest.js +126 -0
- package/src/utils/server-rendering/models.d.ts +27 -0
- package/src/utils/server-rendering/models.js +22 -0
- package/src/utils/server-rendering/prerender.d.ts +26 -10
- package/src/utils/server-rendering/prerender.js +126 -67
- package/src/utils/server-rendering/render-worker.d.ts +9 -8
- package/src/utils/server-rendering/render-worker.js +19 -14
- package/src/utils/server-rendering/routes-extractor-worker.d.ts +6 -10
- package/src/utils/server-rendering/routes-extractor-worker.js +16 -33
- package/src/utils/server-rendering/utils.d.ts +11 -0
- package/src/utils/server-rendering/utils.js +17 -0
- package/src/utils/worker-pool.d.ts +12 -0
- package/src/utils/worker-pool.js +43 -0
- package/src/tools/vite/angular-memory-plugin.d.ts +0 -21
- package/src/utils/server-rendering/main-bundle-exports.d.ts +0 -27
- package/src/utils/server-rendering/render-page.d.ts +0 -26
- package/src/utils/server-rendering/render-page.js +0 -114
- /package/src/tools/vite/{id-prefix-plugin.d.ts → plugins/id-prefix-plugin.d.ts} +0 -0
- /package/src/tools/vite/{id-prefix-plugin.js → plugins/id-prefix-plugin.js} +0 -0
|
@@ -10,7 +10,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.INDEX_HTML_SERVER = exports.INDEX_HTML_CSR = void 0;
|
|
13
14
|
exports.normalizeOptions = normalizeOptions;
|
|
15
|
+
exports.getLocaleBaseHref = getLocaleBaseHref;
|
|
14
16
|
const node_fs_1 = require("node:fs");
|
|
15
17
|
const promises_1 = require("node:fs/promises");
|
|
16
18
|
const node_module_1 = require("node:module");
|
|
@@ -21,7 +23,18 @@ const environment_options_1 = require("../../utils/environment-options");
|
|
|
21
23
|
const i18n_options_1 = require("../../utils/i18n-options");
|
|
22
24
|
const normalize_cache_1 = require("../../utils/normalize-cache");
|
|
23
25
|
const postcss_configuration_1 = require("../../utils/postcss-configuration");
|
|
26
|
+
const url_1 = require("../../utils/url");
|
|
24
27
|
const schema_1 = require("./schema");
|
|
28
|
+
/**
|
|
29
|
+
* The filename for the client-side rendered HTML template.
|
|
30
|
+
* This template is used for client-side rendering (CSR) in a web application.
|
|
31
|
+
*/
|
|
32
|
+
exports.INDEX_HTML_CSR = 'index.csr.html';
|
|
33
|
+
/**
|
|
34
|
+
* The filename for the server-side rendered HTML template.
|
|
35
|
+
* This template is used for server-side rendering (SSR) in a web application.
|
|
36
|
+
*/
|
|
37
|
+
exports.INDEX_HTML_SERVER = 'index.server.html';
|
|
25
38
|
/**
|
|
26
39
|
* Normalize the user provided options by creating full paths for all path based options
|
|
27
40
|
* and converting multi-form options into a single form that can be directly used
|
|
@@ -90,6 +103,29 @@ async function normalizeOptions(context, projectName, options, extensions) {
|
|
|
90
103
|
loaderExtensions[extension] = value;
|
|
91
104
|
}
|
|
92
105
|
}
|
|
106
|
+
// Validate prerender and ssr options when using the outputMode
|
|
107
|
+
if (options.outputMode === schema_1.OutputMode.Server) {
|
|
108
|
+
if (!options.server) {
|
|
109
|
+
throw new Error('The "server" option is required when "outputMode" is set to "server".');
|
|
110
|
+
}
|
|
111
|
+
if (typeof options.ssr === 'boolean' || !options.ssr?.entry) {
|
|
112
|
+
throw new Error('The "ssr.entry" option is required when "outputMode" is set to "server".');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (options.outputMode) {
|
|
116
|
+
if (!options.server) {
|
|
117
|
+
options.ssr = false;
|
|
118
|
+
}
|
|
119
|
+
if (options.prerender) {
|
|
120
|
+
context.logger.warn('The "prerender" option is no longer needed when "outputMode" is specified.');
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
options.prerender = !!options.server;
|
|
124
|
+
}
|
|
125
|
+
if (options.appShell) {
|
|
126
|
+
context.logger.warn('The "appShell" option is no longer needed when "outputMode" is specified.');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
93
129
|
// A configuration file can exist in the project or workspace root
|
|
94
130
|
const searchDirectories = await (0, postcss_configuration_1.generateSearchDirectories)([projectRoot, workspaceRoot]);
|
|
95
131
|
const postcssConfiguration = await (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirectories);
|
|
@@ -138,7 +174,9 @@ async function normalizeOptions(context, projectName, options, extensions) {
|
|
|
138
174
|
clean: options.deleteOutputPath ?? true,
|
|
139
175
|
// For app-shell and SSG server files are not required by users.
|
|
140
176
|
// Omit these when SSR is not enabled.
|
|
141
|
-
ignoreServer: ssrOptions === undefined || serverEntryPoint === undefined
|
|
177
|
+
ignoreServer: ((ssrOptions === undefined || serverEntryPoint === undefined) &&
|
|
178
|
+
options.outputMode === undefined) ||
|
|
179
|
+
options.outputMode === schema_1.OutputMode.Static,
|
|
142
180
|
};
|
|
143
181
|
const outputNames = {
|
|
144
182
|
bundles: options.outputHashing === schema_1.OutputHashing.All || options.outputHashing === schema_1.OutputHashing.Bundles
|
|
@@ -161,10 +199,16 @@ async function normalizeOptions(context, projectName, options, extensions) {
|
|
|
161
199
|
* If SSR is activated, create a distinct entry file for the `index.html`.
|
|
162
200
|
* This is necessary because numerous server/cloud providers automatically serve the `index.html` as a static file
|
|
163
201
|
* if it exists (handling SSG).
|
|
202
|
+
*
|
|
164
203
|
* For instance, accessing `foo.com/` would lead to `foo.com/index.html` being served instead of hitting the server.
|
|
204
|
+
*
|
|
205
|
+
* This approach can also be applied to service workers, where the `index.csr.html` is served instead of the prerendered `index.html`.
|
|
165
206
|
*/
|
|
166
207
|
const indexBaseName = node_path_1.default.basename(options.index);
|
|
167
|
-
indexOutput =
|
|
208
|
+
indexOutput =
|
|
209
|
+
(ssrOptions || prerenderOptions) && indexBaseName === 'index.html'
|
|
210
|
+
? exports.INDEX_HTML_CSR
|
|
211
|
+
: indexBaseName;
|
|
168
212
|
}
|
|
169
213
|
else {
|
|
170
214
|
indexOutput = options.index.output || 'index.html';
|
|
@@ -193,7 +237,7 @@ async function normalizeOptions(context, projectName, options, extensions) {
|
|
|
193
237
|
}
|
|
194
238
|
}
|
|
195
239
|
// Initial options to keep
|
|
196
|
-
const { allowedCommonJsDependencies, aot, baseHref, crossOrigin, externalDependencies, extractLicenses, inlineStyleLanguage = 'css', outExtension, serviceWorker, poll, polyfills, statsJson, stylePreprocessorOptions, subresourceIntegrity, verbose, watch, progress = true, externalPackages, namedChunks, budgets, deployUrl, clearScreen, define, } = options;
|
|
240
|
+
const { allowedCommonJsDependencies, aot, baseHref, crossOrigin, externalDependencies, extractLicenses, inlineStyleLanguage = 'css', outExtension, serviceWorker, poll, polyfills, statsJson, outputMode, stylePreprocessorOptions, subresourceIntegrity, verbose, watch, progress = true, externalPackages, namedChunks, budgets, deployUrl, clearScreen, define, partialSSRBuild = false, externalRuntimeStyles, instrumentForCoverage, } = options;
|
|
197
241
|
// Return all the normalized options
|
|
198
242
|
return {
|
|
199
243
|
advancedOptimizations: !!aot && optimizationOptions.scripts,
|
|
@@ -216,6 +260,7 @@ async function normalizeOptions(context, projectName, options, extensions) {
|
|
|
216
260
|
serverEntryPoint,
|
|
217
261
|
prerenderOptions,
|
|
218
262
|
appShellOptions,
|
|
263
|
+
outputMode,
|
|
219
264
|
ssrOptions,
|
|
220
265
|
verbose,
|
|
221
266
|
watch,
|
|
@@ -248,6 +293,9 @@ async function normalizeOptions(context, projectName, options, extensions) {
|
|
|
248
293
|
colors: (0, color_1.supportColor)(),
|
|
249
294
|
clearScreen,
|
|
250
295
|
define,
|
|
296
|
+
partialSSRBuild: environment_options_1.usePartialSsrBuild || partialSSRBuild,
|
|
297
|
+
externalRuntimeStyles,
|
|
298
|
+
instrumentForCoverage,
|
|
251
299
|
};
|
|
252
300
|
}
|
|
253
301
|
async function getTailwindConfig(searchDirectories, workspaceRoot, context) {
|
|
@@ -369,3 +417,12 @@ function normalizeGlobalEntries(rawEntries, defaultName) {
|
|
|
369
417
|
}
|
|
370
418
|
return [...bundles.values()];
|
|
371
419
|
}
|
|
420
|
+
function getLocaleBaseHref(baseHref, i18n, locale) {
|
|
421
|
+
if (i18n.flatOutput) {
|
|
422
|
+
return undefined;
|
|
423
|
+
}
|
|
424
|
+
if (i18n.locales[locale] && i18n.locales[locale].baseHref !== '') {
|
|
425
|
+
return (0, url_1.urlJoin)(baseHref || '', i18n.locales[locale].baseHref ?? `/${locale}/`);
|
|
426
|
+
}
|
|
427
|
+
return undefined;
|
|
428
|
+
}
|
|
@@ -117,6 +117,12 @@ export interface Schema {
|
|
|
117
117
|
* Define the output filename cache-busting hashing mode.
|
|
118
118
|
*/
|
|
119
119
|
outputHashing?: OutputHashing;
|
|
120
|
+
/**
|
|
121
|
+
* Defines the build output target. 'static': Generates a static site for deployment on any
|
|
122
|
+
* static hosting service. 'server': Produces an application designed for deployment on a
|
|
123
|
+
* server that supports server-side rendering (SSR).
|
|
124
|
+
*/
|
|
125
|
+
outputMode?: OutputMode;
|
|
120
126
|
/**
|
|
121
127
|
* Specify the output path relative to workspace root.
|
|
122
128
|
*/
|
|
@@ -393,6 +399,15 @@ export declare enum OutputHashing {
|
|
|
393
399
|
Media = "media",
|
|
394
400
|
None = "none"
|
|
395
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Defines the build output target. 'static': Generates a static site for deployment on any
|
|
404
|
+
* static hosting service. 'server': Produces an application designed for deployment on a
|
|
405
|
+
* server that supports server-side rendering (SSR).
|
|
406
|
+
*/
|
|
407
|
+
export declare enum OutputMode {
|
|
408
|
+
Server = "server",
|
|
409
|
+
Static = "static"
|
|
410
|
+
}
|
|
396
411
|
/**
|
|
397
412
|
* Specify the output path relative to workspace root.
|
|
398
413
|
*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
3
|
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.OutputHashing = exports.InlineStyleLanguage = exports.I18NTranslation = exports.CrossOrigin = exports.Type = void 0;
|
|
5
|
+
exports.OutputMode = exports.OutputHashing = exports.InlineStyleLanguage = exports.I18NTranslation = exports.CrossOrigin = exports.Type = void 0;
|
|
6
6
|
/**
|
|
7
7
|
* The type of budget.
|
|
8
8
|
*/
|
|
@@ -56,3 +56,13 @@ var OutputHashing;
|
|
|
56
56
|
OutputHashing["Media"] = "media";
|
|
57
57
|
OutputHashing["None"] = "none";
|
|
58
58
|
})(OutputHashing || (exports.OutputHashing = OutputHashing = {}));
|
|
59
|
+
/**
|
|
60
|
+
* Defines the build output target. 'static': Generates a static site for deployment on any
|
|
61
|
+
* static hosting service. 'server': Produces an application designed for deployment on a
|
|
62
|
+
* server that supports server-side rendering (SSR).
|
|
63
|
+
*/
|
|
64
|
+
var OutputMode;
|
|
65
|
+
(function (OutputMode) {
|
|
66
|
+
OutputMode["Server"] = "server";
|
|
67
|
+
OutputMode["Static"] = "static";
|
|
68
|
+
})(OutputMode || (exports.OutputMode = OutputMode = {}));
|
|
@@ -528,6 +528,11 @@
|
|
|
528
528
|
"type": "boolean",
|
|
529
529
|
"description": "Generates an application shell during build time.",
|
|
530
530
|
"default": false
|
|
531
|
+
},
|
|
532
|
+
"outputMode": {
|
|
533
|
+
"type": "string",
|
|
534
|
+
"description": "Defines the build output target. 'static': Generates a static site for deployment on any static hosting service. 'server': Produces an application designed for deployment on a server that supports server-side rendering (SSR).",
|
|
535
|
+
"enum": ["static", "server"]
|
|
531
536
|
}
|
|
532
537
|
},
|
|
533
538
|
"additionalProperties": false,
|
|
@@ -22,22 +22,22 @@ const utils_1 = require("../../tools/esbuild/utils");
|
|
|
22
22
|
* @returns An array of BundlerContext objects.
|
|
23
23
|
*/
|
|
24
24
|
function setupBundlerContexts(options, browsers, codeBundleCache) {
|
|
25
|
-
const { appShellOptions, prerenderOptions,
|
|
25
|
+
const { outputMode, serverEntryPoint, appShellOptions, prerenderOptions, ssrOptions, workspaceRoot, watch = false, } = options;
|
|
26
26
|
const target = (0, utils_1.transformSupportedBrowsersToTargets)(browsers);
|
|
27
27
|
const bundlerContexts = [];
|
|
28
28
|
// Browser application code
|
|
29
|
-
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot,
|
|
29
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createBrowserCodeBundleOptions)(options, target, codeBundleCache)));
|
|
30
30
|
// Browser polyfills code
|
|
31
31
|
const browserPolyfillBundleOptions = (0, application_code_bundle_1.createBrowserPolyfillBundleOptions)(options, target, codeBundleCache);
|
|
32
32
|
if (browserPolyfillBundleOptions) {
|
|
33
|
-
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot,
|
|
33
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, browserPolyfillBundleOptions));
|
|
34
34
|
}
|
|
35
35
|
// Global Stylesheets
|
|
36
36
|
if (options.globalStyles.length > 0) {
|
|
37
37
|
for (const initial of [true, false]) {
|
|
38
38
|
const bundleOptions = (0, global_styles_1.createGlobalStylesBundleOptions)(options, target, initial);
|
|
39
39
|
if (bundleOptions) {
|
|
40
|
-
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot,
|
|
40
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, bundleOptions, () => initial));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -46,19 +46,22 @@ function setupBundlerContexts(options, browsers, codeBundleCache) {
|
|
|
46
46
|
for (const initial of [true, false]) {
|
|
47
47
|
const bundleOptions = (0, global_scripts_1.createGlobalScriptsBundleOptions)(options, target, initial);
|
|
48
48
|
if (bundleOptions) {
|
|
49
|
-
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot,
|
|
49
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, bundleOptions, () => initial));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
// Skip server build when none of the features are enabled.
|
|
54
|
-
if (serverEntryPoint && (prerenderOptions || appShellOptions || ssrOptions)) {
|
|
54
|
+
if (serverEntryPoint && (outputMode || prerenderOptions || appShellOptions || ssrOptions)) {
|
|
55
55
|
const nodeTargets = [...target, ...(0, utils_1.getSupportedNodeTargets)()];
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createServerMainCodeBundleOptions)(options, nodeTargets, codeBundleCache)));
|
|
57
|
+
if (outputMode && ssrOptions?.entry) {
|
|
58
|
+
// New behavior introduced: 'server.ts' is now bundled separately from 'main.server.ts'.
|
|
59
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, (0, application_code_bundle_1.createSsrEntryCodeBundleOptions)(options, nodeTargets, codeBundleCache)));
|
|
60
|
+
}
|
|
58
61
|
// Server polyfills code
|
|
59
62
|
const serverPolyfillBundleOptions = (0, application_code_bundle_1.createServerPolyfillBundleOptions)(options, nodeTargets, codeBundleCache);
|
|
60
63
|
if (serverPolyfillBundleOptions) {
|
|
61
|
-
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot,
|
|
64
|
+
bundlerContexts.push(new bundler_context_1.BundlerContext(workspaceRoot, watch, serverPolyfillBundleOptions));
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
return bundlerContexts;
|
|
@@ -9,7 +9,6 @@ export { type BuildOutputFile, BuildOutputFileType } from '@angular/build';
|
|
|
9
9
|
export { createRxjsEsmResolutionPlugin } from '../../tools/esbuild/rxjs-esm-resolution-plugin';
|
|
10
10
|
export { JavaScriptTransformer } from '../../tools/esbuild/javascript-transformer';
|
|
11
11
|
export { getFeatureSupport, isZonelessApp } from '../../tools/esbuild/utils';
|
|
12
|
-
export { renderPage } from '../../utils/server-rendering/render-page';
|
|
13
12
|
export { type IndexHtmlTransform } from '../../utils/index-file/index-html-generator';
|
|
14
13
|
export { purgeStaleBuildCache } from '../../utils/purge-cache';
|
|
15
14
|
export { getSupportedBrowsers } from '../../utils/supported-browsers';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.buildApplicationInternal = exports.transformSupportedBrowsersToTargets = exports.getSupportedBrowsers = exports.purgeStaleBuildCache = exports.
|
|
10
|
+
exports.buildApplicationInternal = exports.transformSupportedBrowsersToTargets = exports.getSupportedBrowsers = exports.purgeStaleBuildCache = exports.isZonelessApp = exports.getFeatureSupport = exports.JavaScriptTransformer = exports.createRxjsEsmResolutionPlugin = exports.BuildOutputFileType = void 0;
|
|
11
11
|
var build_1 = require("@angular/build");
|
|
12
12
|
Object.defineProperty(exports, "BuildOutputFileType", { enumerable: true, get: function () { return build_1.BuildOutputFileType; } });
|
|
13
13
|
var rxjs_esm_resolution_plugin_1 = require("../../tools/esbuild/rxjs-esm-resolution-plugin");
|
|
@@ -17,8 +17,6 @@ Object.defineProperty(exports, "JavaScriptTransformer", { enumerable: true, get:
|
|
|
17
17
|
var utils_1 = require("../../tools/esbuild/utils");
|
|
18
18
|
Object.defineProperty(exports, "getFeatureSupport", { enumerable: true, get: function () { return utils_1.getFeatureSupport; } });
|
|
19
19
|
Object.defineProperty(exports, "isZonelessApp", { enumerable: true, get: function () { return utils_1.isZonelessApp; } });
|
|
20
|
-
var render_page_1 = require("../../utils/server-rendering/render-page");
|
|
21
|
-
Object.defineProperty(exports, "renderPage", { enumerable: true, get: function () { return render_page_1.renderPage; } });
|
|
22
20
|
var purge_cache_1 = require("../../utils/purge-cache");
|
|
23
21
|
Object.defineProperty(exports, "purgeStaleBuildCache", { enumerable: true, get: function () { return purge_cache_1.purgeStaleBuildCache; } });
|
|
24
22
|
var supported_browsers_1 = require("../../utils/supported-browsers");
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
import type { BuilderContext } from '@angular-devkit/architect';
|
|
9
9
|
import type { Plugin } from 'esbuild';
|
|
10
10
|
import type { Connect, DepOptimizationConfig, InlineConfig } from 'vite';
|
|
11
|
+
import { ServerSsrMode } from '../../tools/vite/plugins';
|
|
11
12
|
import { Result } from '../application/results';
|
|
12
|
-
import { type ApplicationBuilderInternalOptions, type ExternalResultMetadata, JavaScriptTransformer } from './internal';
|
|
13
|
+
import { type ApplicationBuilderInternalOptions, BuildOutputFileType, type ExternalResultMetadata, JavaScriptTransformer } from './internal';
|
|
13
14
|
import type { NormalizedDevServerOptions } from './options';
|
|
14
15
|
import type { DevServerBuilderOutput } from './output';
|
|
15
16
|
interface OutputFileRecord {
|
|
@@ -18,6 +19,11 @@ interface OutputFileRecord {
|
|
|
18
19
|
hash?: string;
|
|
19
20
|
updated: boolean;
|
|
20
21
|
servable: boolean;
|
|
22
|
+
type: BuildOutputFileType;
|
|
23
|
+
}
|
|
24
|
+
interface DevServerExternalResultMetadata extends Omit<ExternalResultMetadata, 'explicit'> {
|
|
25
|
+
explicitBrowser: string[];
|
|
26
|
+
explicitServer: string[];
|
|
21
27
|
}
|
|
22
28
|
export type BuilderAction = (options: ApplicationBuilderInternalOptions, context: BuilderContext, plugins?: Plugin[]) => AsyncIterable<Result>;
|
|
23
29
|
export declare function serveWithVite(serverOptions: NormalizedDevServerOptions, builderName: string, builderAction: BuilderAction, context: BuilderContext, transformers?: {
|
|
@@ -26,6 +32,6 @@ export declare function serveWithVite(serverOptions: NormalizedDevServerOptions,
|
|
|
26
32
|
middleware?: Connect.NextHandleFunction[];
|
|
27
33
|
buildPlugins?: Plugin[];
|
|
28
34
|
}): AsyncIterableIterator<DevServerBuilderOutput>;
|
|
29
|
-
export declare function setupServer(serverOptions: NormalizedDevServerOptions, outputFiles: Map<string, OutputFileRecord>, assets: Map<string, string>, preserveSymlinks: boolean | undefined, externalMetadata:
|
|
35
|
+
export declare function setupServer(serverOptions: NormalizedDevServerOptions, outputFiles: Map<string, OutputFileRecord>, assets: Map<string, string>, preserveSymlinks: boolean | undefined, externalMetadata: DevServerExternalResultMetadata, ssrMode: ServerSsrMode, prebundleTransformer: JavaScriptTransformer, target: string[], zoneless: boolean, usedComponentStyles: Map<string, string[]>, prebundleLoaderExtensions: EsbuildLoaderOption | undefined, extensionMiddleware?: Connect.NextHandleFunction[], indexHtmlTransformer?: (content: string) => Promise<string>, thirdPartySourcemaps?: boolean): Promise<InlineConfig>;
|
|
30
36
|
type EsbuildLoaderOption = Exclude<DepOptimizationConfig['esbuildOptions'], undefined>['loader'];
|
|
31
37
|
export {};
|