1

I have an Angular 16 app that I built using Angular Universal to pre-render the pages for SEO purposes.

I run ng run project-name:prerender and it generates the following structure

├─ dist
│  ├─ project-name
│  │  ├─ browser
│  │  ├─ server

I can run the dist/project-name/browser locally and everything works as expected.

So my question is: do I need to do anything with the dist/project-name/server directory?

I understand it's there for server-side rendering, but this is a fairly simple application (just a dev/design portfolio for myself) and I have no need for anything to happen server side that I know of.

Chris Barr
  • 29,851
  • 23
  • 95
  • 135
  • It says https://angular.io/guide/prerendering there *To prerender a static page make sure to add Server-Side Rendering (SSR) capabilities to your application.* – Moshe Fortgang Jun 29 '23 at 12:54
  • Yes I realize that, but my question is: do I need to do anything with the `/server` directory, or can I just disregard that? – Chris Barr Jun 29 '23 at 13:23
  • Following. But it seems to work as expected with only the `browser` folder. I don't know why nguniversal generates a `server` folder though – Pieterjan Jun 30 '23 at 12:34
  • Correct. I've looked through their docs and there doesn't seem to be a way to only generate one or the other. You can only get both, and then I guess you just whichever ones you need. I wish I could disable generating the `server` folder though as it takes a bit longer to build and generates some errors about certain `window.*` methods not existing – Chris Barr Jun 30 '23 at 13:32

0 Answers0