Include a plain HTML file and folder with Angular CLI Build?

Add the static folder in your project and with index.html in it. Then, just add an entry to the target folder under assets in your .angular-cli.json:

"assets": [
        "assets",
        "favicon.ico",
        "static" 
      ],

According to the docs, you can do this in .angular-cli.json. Add an entry to the apps assets array, similar to the following:

{ "glob": "index.html", "output": "static" }

This assumes that index.html is in the src folder. You can also include an input property in the object if the source directory is different.


I came across this via a search for the same issue. The Angular documentation and file structure has changed a bit since previous posts.

Now configure it in angular.json and it is documented here:

https://angular.io/guide/workspace-config#assets-configuration

Tags:

Angular