@nx/angular:setup-ssr
Create the additional configuration required to enable SSR via Angular Universal for an Angular application.
Create the additional configuration required to enable SSR via Angular Universal for an Angular application.
1nx generate setup-ssr ...
2By default, Nx will search for setup-ssr in the default collection provisioned in workspace.json.
You can specify the collection explicitly as follows:
1nx g @nx/angular:setup-ssr ...
2Show what will be generated without writing to disk:
1nx g setup-ssr ... --dry-run
2The name of the application to generate the Angular Universal configuration for.
serverAppFormat: html-selectorThe appId to use with withServerTransition. Note: This is only used in Angular versions <16.0.0. It's deprecated since Angular 16.
Set up Hydration for the SSR application. Note: This is only supported in Angular versions >= 16.0.0.
main.server.tsFormat: pathThe name of the main entry-point file.
app.server.module.tsFormat: pathThe name of the root module file
AppServerModuleThe name of the root module class.
server.tsThe name of the Express server file.
4000The port for the Express server.
Use Standalone Components to bootstrap SSR. Note: This is only supported in Angular versions >= 14.1.0.
Skip formatting the workspace after the generator completes.