Reader small image

You're reading from  Angular Projects - Third Edition

Product typeBook
Published inJul 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781803239118
Edition3rd Edition
Languages
Tools
Right arrow
Author (1)
Aristeidis Bampakos
Aristeidis Bampakos
author image
Aristeidis Bampakos

Aristeidis Bampakos is a Web Development Team Lead at Plex-Earth who specializes in the development of web applications with Angular. He has been an Angular Google Developer Expert (GDE) since 2020 and works as an Angular Senior Tech Instructor at Code.Hub, a private educational institute, where he nurtures aspiring Angular developers and professionals. He is also the author of Angular Projects with Packt.
Read more about Aristeidis Bampakos

Right arrow

Prerendering content during build

The package.json file of our Angular CLI workspace contains the prerender npm script that we can use to improve the first loading of our application. The script runs the prerender command from the architect section of the angular.json configuration file and prerenders the content of our application during build time. Let's see the effect that prerendering will have on our GitHub portfolio application:

  1. Execute the following npm command to generate a prerendered version of the application:
npm run prerender
  1. The preceding command will output a production bundle of the application into the dist\gh-portfolio\browser folder.
  2. Navigate to the dist\gh-portfolio\browser folder and you should see two HTML files, the index.html and the index.original.html file.
  3. Open the index.original.html file and locate the <app-root> HTML element. This is the main component of our Angular application, where Angular will render the content of our application in...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Angular Projects - Third Edition
Published in: Jul 2023Publisher: PacktISBN-13: 9781803239118

Author (1)

author image
Aristeidis Bampakos

Aristeidis Bampakos is a Web Development Team Lead at Plex-Earth who specializes in the development of web applications with Angular. He has been an Angular Google Developer Expert (GDE) since 2020 and works as an Angular Senior Tech Instructor at Code.Hub, a private educational institute, where he nurtures aspiring Angular developers and professionals. He is also the author of Angular Projects with Packt.
Read more about Aristeidis Bampakos