How Do I Setup The Angular Universal Module For Crawling Of Angular 11 App?

I am setting up a new Angular 11 app and I would like to use the Angular Universal Module for my app to be crawlable. However when I search online, results refer mostly to building an Angular universal application, which we would like to avoid.

How could I setup the Angular Universal Module, so that our SPA will be properly crawled (other than just installing it)? And would we need to do something additionally, as we develop new pages / components?




You can add angular universal to an existing app. There is a simple guide here:

Angular universal on existing project

You need to run npm run build:ssr to get the dist folder that contains all the bundles of your app and run npm run serve:ssr to start your project.

Of course, you can create a script to run both processes only once. Example:

"build:ssr:prod": "first:command && second:command"

I recommend you implement a tool like Jenkins or something similar to automatize this task. There are many ways to automatize the deployment of your application. At this moment I use Jenkins to build and deploy my angular universal application.