Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/angular/build/src/builders/application/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ export async function normalizeOptions(
options.ssr = false;
}

if (options.prerender) {
if (options.prerender !== undefined) {
context.logger.warn(
'The "prerender" option is no longer needed when "outputMode" is specified.',
'The "prerender" option is not considered when "outputMode" is specified.',
);
} else {
options.prerender = !!options.server;
}

if (options.appShell) {
options.prerender = !!options.server;

if (options.appShell !== undefined) {
context.logger.warn(
'The "appShell" option is no longer needed when "outputMode" is specified.',
'The "appShell" option is not considered when "outputMode" is specified.',
);
}
}
Expand Down
17 changes: 13 additions & 4 deletions packages/angular/build/src/builders/application/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@
},
"server": {
"type": "string",
"description": "The full path for the server entry point to the application, relative to the current workspace."
"description": "The full path for the server entry point to the application, relative to the current workspace.",
"oneOf": [
{
"type": "string",
"description": "The full path for the server entry point to the application, relative to the current workspace."
},
{
"const": false,
"type": "boolean",
"description": "Indicates that a server entry point is not provided."
}
]
},
"polyfills": {
"description": "A list of polyfills to include in the build. Can be a full path for a file, relative to the current workspace or module specifier. Example: 'zone.js'.",
Expand Down Expand Up @@ -536,7 +547,6 @@
},
"prerender": {
"description": "Prerender (SSG) pages of your application during build time.",
"default": false,
"oneOf": [
{
"type": "boolean",
Expand Down Expand Up @@ -586,8 +596,7 @@
},
"appShell": {
"type": "boolean",
"description": "Generates an application shell during build time.",
"default": false
"description": "Generates an application shell during build time."
},
"outputMode": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export async function* serveWithVite(
if (browserOptions.prerender || (browserOptions.outputMode && browserOptions.server)) {
// Disable prerendering if enabled and force SSR.
// This is so instead of prerendering all the routes for every change, the page is "prerendered" when it is requested.
browserOptions.prerender = false;
browserOptions.prerender = undefined;
browserOptions.ssr ||= true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ export async function extractMessages(
buildOptions.serviceWorker = false;
buildOptions.server = undefined;
buildOptions.ssr = false;
buildOptions.appShell = false;
buildOptions.prerender = false;
buildOptions.appShell = undefined;
buildOptions.prerender = undefined;
buildOptions.outputMode = undefined;

const builderResult = await first(buildApplicationInternal(buildOptions, context));

Expand Down