How to replace "builder": "@nguniversal/builders:ssr-dev-server" with the new "@angular/ssr"

Discussão em 'Angular' iniciado por alex351, Janeiro 9, 2025.

  1. alex351

    alex351 Guest

    I am trying to update an existing Angular Ionic project with the new "@angular/ssr", because SSR just isn't working the way I want.

    ng add @angular/ssr is kind of difficult, because it messes up my existing configuration. I believe it assumes an Angular Standalone setup. And it produces a ton of errors while building.

    I guess the first question would be, is it even possible to get SSR working without the new standalone mode?

    Second and main question:

    Is it possible, and how, to replace the "builder": "@nguniversal/builders:ssr-dev-server"?

    "serve-ssr": {
    "builder": "@nguniversal/builders:ssr-dev-server",
    "options": {
    "browserTarget": "app:build",
    "serverTarget": "app:server"
    },
    "configurations": {
    "production": {
    "browserTarget": "app:build:production",
    "serverTarget": "app:server:production"
    },
    "qa": {
    "browserTarget": "app:build:qa",
    "serverTarget": "app:server:qa"
    }
    }
    },


    [​IMG]

    I am hoping to get it working again. No need for standalone components, prerendering routes, no need for lazy loaded components. Just Angular, Ionic and SSR.

    Continue reading...

Compartilhe esta Página