diff --git a/packages/angular/ssr/schematics/ng-add/index.ts b/packages/angular/ssr/schematics/ng-add/index.ts index f6bdd5d06f27..8b45dab40eda 100644 --- a/packages/angular/ssr/schematics/ng-add/index.ts +++ b/packages/angular/ssr/schematics/ng-add/index.ts @@ -109,7 +109,7 @@ function updateApplicationBuilderWorkspaceConfigRule( } prodConfig.prerender = true; - (prodConfig.ssr ??= {}).entry = join(normalize(projectRoot), 'server.ts'); + prodConfig.ssr = join(normalize(projectRoot), 'server.ts'); }); }; } diff --git a/packages/angular_devkit/build_angular/src/builders/application/options.ts b/packages/angular_devkit/build_angular/src/builders/application/options.ts index 9bea5e7218c4..98f7ace920eb 100644 --- a/packages/angular_devkit/build_angular/src/builders/application/options.ts +++ b/packages/angular_devkit/build_angular/src/builders/application/options.ts @@ -197,11 +197,9 @@ export async function normalizeOptions( let ssrOptions; if (options.ssr === true) { ssrOptions = {}; - } else if (typeof options.ssr === 'object') { - const { entry } = options.ssr; - + } else if (typeof options.ssr === 'string') { ssrOptions = { - entry: entry && path.join(workspaceRoot, entry), + entry: path.join(workspaceRoot, options.ssr), }; } diff --git a/packages/angular_devkit/build_angular/src/builders/application/schema.json b/packages/angular_devkit/build_angular/src/builders/application/schema.json index 9499a2542b1b..e3e4411afb52 100644 --- a/packages/angular_devkit/build_angular/src/builders/application/schema.json +++ b/packages/angular_devkit/build_angular/src/builders/application/schema.json @@ -452,14 +452,8 @@ "description": "Enable the server bundles to be written to disk." }, { - "type": "object", - "properties": { - "entry": { - "type": "string", - "description": "The server entry-point that when executed will spawn the web server." - } - }, - "additionalProperties": false + "type": "string", + "description": "The server entry-point that when executed will spawn the web server." } ] }, diff --git a/packages/angular_devkit/build_angular/src/builders/application/tests/options/ssr_spec.ts b/packages/angular_devkit/build_angular/src/builders/application/tests/options/ssr_spec.ts index 3de28bbe2f36..658c7af8a582 100644 --- a/packages/angular_devkit/build_angular/src/builders/application/tests/options/ssr_spec.ts +++ b/packages/angular_devkit/build_angular/src/builders/application/tests/options/ssr_spec.ts @@ -27,9 +27,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { harness.useTarget('build', { ...BASE_OPTIONS, server: 'src/main.server.ts', - ssr: { - entry: 'src/server.ts', - }, + ssr: 'src/server.ts', }); const { result } = await harness.executeOnce(); @@ -45,9 +43,7 @@ describeBuilder(buildApplication, APPLICATION_BUILDER_INFO, (harness) => { harness.useTarget('build', { ...BASE_OPTIONS, server: 'src/main.server.ts', - ssr: { - entry: '/file.mjs', - }, + ssr: '/file.mjs', }); const { result } = await harness.executeOnce();