diff --git a/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap b/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap index 3d22e42e747ba..9f7c499bff352 100644 --- a/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap +++ b/packages/angular/src/generators/host/__snapshots__/host.spec.ts.snap @@ -102,7 +102,7 @@ platformBrowserDynamic() `; exports[`Host App Generator --ssr should generate the correct files 3`] = ` -"export { AppServerModule } from './app/app.server.module'; +"export { AppServerModule as default } from './app/app.server.module'; " `; @@ -722,7 +722,7 @@ platformBrowserDynamic() `; exports[`Host App Generator --ssr should generate the correct files when --typescript=true 3`] = ` -"export { AppServerModule } from './app/app.server.module'; +"export { AppServerModule as default } from './app/app.server.module'; " `; diff --git a/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap b/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap index 14e319493368b..0d49b11393ac3 100644 --- a/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap +++ b/packages/angular/src/generators/remote/__snapshots__/remote.spec.ts.snap @@ -117,7 +117,7 @@ platformBrowserDynamic() `; exports[`MF Remote App Generator --ssr should generate the correct files 3`] = ` -"export { AppServerModule } from './app/app.server.module'; +"export { AppServerModule as default } from './app/app.server.module'; " `; @@ -339,7 +339,7 @@ platformBrowserDynamic() `; exports[`MF Remote App Generator --ssr should generate the correct files when --typescriptConfiguration=true 3`] = ` -"export { AppServerModule } from './app/app.server.module'; +"export { AppServerModule as default } from './app/app.server.module'; " `; diff --git a/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap b/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap index 4a16b3c8bdad9..5c6b3045c1c98 100644 --- a/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap +++ b/packages/angular/src/generators/setup-ssr/__snapshots__/setup-ssr.spec.ts.snap @@ -8,7 +8,7 @@ import { ngExpressEngine } from '@nguniversal/express-engine'; import * as express from 'express'; import { existsSync } from 'fs'; import { join } from 'path'; -import { AppServerModule } from './src/main.server'; +import AppServerModule from './src/main.server'; // The Express app is exported so that it can be used by serverless Functions. export function app(): express.Express { @@ -123,7 +123,7 @@ import { CommonEngine } from '@angular/ssr'; import express from 'express'; import { fileURLToPath } from 'node:url'; import { dirname, join, resolve } from 'node:path'; -import { AppServerModule } from './src/main.server'; +import AppServerModule from './src/main.server'; // The Express app is exported so that it can be used by serverless Functions. export function app(): express.Express { @@ -332,7 +332,7 @@ import { CommonEngine } from '@angular/ssr'; import * as express from 'express'; import { existsSync } from 'node:fs'; import { join } from 'node:path'; -import { AppServerModule } from './src/main.server'; +import AppServerModule from './src/main.server'; // The Express app is exported so that it can be used by serverless Functions. export function app(): express.Express { diff --git a/packages/angular/src/generators/setup-ssr/files/ngmodule/base/src/__main__ b/packages/angular/src/generators/setup-ssr/files/ngmodule/base/src/__main__ index 80cb99598bd4d..063a6f9eac8a5 100644 --- a/packages/angular/src/generators/setup-ssr/files/ngmodule/base/src/__main__ +++ b/packages/angular/src/generators/setup-ssr/files/ngmodule/base/src/__main__ @@ -1 +1 @@ -export { <%= rootModuleClassName %> } from './app/<%= rootModuleFileName.slice(0, -3) %>'; +export { <%= rootModuleClassName %> as default } from './app/<%= rootModuleFileName.slice(0, -3) %>'; diff --git a/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ b/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ index 3722495738478..e0f5fa09694d6 100644 --- a/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ +++ b/packages/angular/src/generators/setup-ssr/files/server/application-builder/__serverFileName__ @@ -3,7 +3,7 @@ import { CommonEngine } from '@angular/ssr'; import express from 'express'; import { fileURLToPath } from 'node:url'; import { dirname, join, resolve } from 'node:path'; -import <% if (standalone) { %>bootstrap<% } else { %>{ <%= rootModuleClassName %> }<% } %> from './src/<%= main.slice(0, -3) %>'; +import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './src/<%= main.slice(0, -3) %>'; // The Express app is exported so that it can be used by serverless Functions. export function app(): express.Express { diff --git a/packages/angular/src/generators/setup-ssr/files/server/server-builder/pre-v17/__serverFileName__ b/packages/angular/src/generators/setup-ssr/files/server/server-builder/pre-v17/__serverFileName__ index cb66f4408c955..4a168804a6543 100644 --- a/packages/angular/src/generators/setup-ssr/files/server/server-builder/pre-v17/__serverFileName__ +++ b/packages/angular/src/generators/setup-ssr/files/server/server-builder/pre-v17/__serverFileName__ @@ -5,7 +5,7 @@ import { ngExpressEngine } from '@nguniversal/express-engine'; import * as express from 'express'; import { existsSync } from 'fs'; import { join } from 'path'; -import <% if (standalone) { %>bootstrap<% } else { %>{ <%= rootModuleClassName %> }<% } %> from './src/<%= main.slice(0, -3) %>'; +import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './src/<%= main.slice(0, -3) %>'; // The Express app is exported so that it can be used by serverless Functions. export function app(): express.Express { diff --git a/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ b/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ index c3e215b7c3b7f..5774e30795e48 100644 --- a/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ +++ b/packages/angular/src/generators/setup-ssr/files/server/server-builder/v17+/__serverFileName__ @@ -5,7 +5,7 @@ import { CommonEngine } from '@angular/ssr'; import * as express from 'express'; import { existsSync } from 'node:fs'; import { join } from 'node:path'; -import <% if (standalone) { %>bootstrap<% } else { %>{ <%= rootModuleClassName %> }<% } %> from './src/<%= main.slice(0, -3) %>'; +import <% if (standalone) { %>bootstrap<% } else { %><%= rootModuleClassName %><% } %> from './src/<%= main.slice(0, -3) %>'; // The Express app is exported so that it can be used by serverless Functions. export function app(): express.Express { diff --git a/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts b/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts index 380ea58228836..81bbca4b8a4ce 100644 --- a/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts +++ b/packages/angular/src/generators/setup-ssr/setup-ssr.spec.ts @@ -38,7 +38,7 @@ describe('setupSSR', () => { expect(tree.read('app1/server.ts', 'utf-8')).toMatchSnapshot(); expect(tree.read('app1/src/main.server.ts', 'utf-8')) .toMatchInlineSnapshot(` - "export { AppServerModule } from './app/app.server.module'; + "export { AppServerModule as default } from './app/app.server.module'; " `); expect(tree.read('app1/src/main.ts', 'utf-8')).toMatchInlineSnapshot(` @@ -204,7 +204,7 @@ describe('setupSSR', () => { expect(tree.read('app1/server.ts', 'utf-8')).toMatchSnapshot(); expect(tree.read('app1/src/main.server.ts', 'utf-8')) .toMatchInlineSnapshot(` - "export { AppServerModule } from './app/app.server.module'; + "export { AppServerModule as default } from './app/app.server.module'; " `); expect(tree.read('app1/src/main.ts', 'utf-8')).toMatchInlineSnapshot(`