Search code examples
angularangular-cliangular7angular-cli-v6

Angular 7 relocate Assets File after Build


I have this sitemap.xml file in my assets folder under src: assets folder

When building my project via the cli with ng build --prod the resulting folder looks like this: assets folder

My question is simply how I can move the sitemap.xml file outside the assets folder when building my project?


Solution

  • Based on the documentation here, you just need to update your angular.json file.

    Something like the following should work for your sitemap file:

    "assets": [{ "glob": "sitemap.xml", "input": "src/assets/", "output": "/" }],