Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular ng build prerendered routes like angular universal for static serving #FeatureRequest #9128

Closed
manuelfink opened this issue Jan 8, 2018 · 3 comments
Labels
feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion

Comments

@manuelfink
Copy link

I'm submitting a Feature Request

Is it possible to build an angular app with several prerendered routes with angular-cli?

I'm thinking of something similar to angular universal prerendering just during the angular cli build process for predefined routes but for static serving without having the overhead of setting up serverside rendering.

Is this possible as default functionality?
Anyone else thinks this is would be handy/needed for angular-cli?

Current behavior

seem not to be available as build option. At least I could not find it.

Expected behavior

  • add routes to prerender while building in .angular-cli.json
  • on ng build create prerendered index.html files in dist folder for defined routes

For example:

./dist/index.html << this is default!
// Additional build prerendered index.html files for specified routes
./dist/routeA/index.html
./dist/routeB/index.html
./dist/routeC/customRouteParam/index.html

Angular Universal Prerendering - Current working solution

This is already shown as an implementation within Angular Universal Starter Pack, but is not a default functionality angular-cli yet. Not sure if this works for all apps without making any consideration on universal and serverside rendering, since some implication must be made for this to work. Details for prerendering see:

Why static prerendering of Angular?

  • Allow static serving avoiding extra complexity of server-side rendering
  • Keep advantages of universal app and serverside rendering
  • Improving load time
  • Support for Open Graph Tags (OG Tags)
  • ...

I posted the same question on stackoverflow, then as Issue in Angular repository with note, that this is an angular-cli feature request.

@clydin clydin added P5 The team acknowledges the request but does not plan to address it, it remains open for discussion feature Issue that requests a new feature labels Jan 8, 2018
@hansl hansl unassigned Brocco Feb 6, 2018
@Toxicable
Copy link

I don't think this is the domain of the CLI.
Im working on this little tools over here angular/universal#778 which would achieve the same goal. It would allow you to get a list of routes, then you'd be able to iterate over them producing generated routes

@filipesilva
Copy link
Contributor

Closing as per the comment above.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature P5 The team acknowledges the request but does not plan to address it, it remains open for discussion
Projects
None yet
Development

No branches or pull requests

5 participants