February 9, 2018

Angular CLI: Add Sitemap.xml and Robots.txt File

As Developer you may get the task to add a Sitemap and a robot.txt to your Angular CLI Project, this is quite easy.

Copy the files next to the favicon.ico  into the /src  folder of your Angular project.

Now open up the  .angular-cli.json  in the projects root folder and add the two files under assets , as follows:

 

Restart your Angular build and the files should be served directly.

You can add more files as you please.


Frederik von Berg

Entwickler bei thecodecampus

Leave a Reply

Your email address will not be published. Required fields are marked *