Manage assets and static files with Angular CLI One of the easiest way to build Angular applicationns is through Angular CLI. Using the ng serve command will build and serve the whole application or we can use ng build to output the app into the outputDir folder, but there might be occasions where we need to serve files which aren’t part of the Angular process, like static files or images. Those files are referred to as assets . Today we will see how we can configure Angular CLI to copy assets to the output directory and what sort of configuration is available. 1. Copying assets 2. Glob file, input, output 1. Copying assets Files which need to be served by AngularCLI must be registered under assets in the .angular-cli.json file. When we first boostrap a project, there are two places registered under assets : { "apps": [{ "root": "src", "outDir": "dist", "assets": [ "assets",
Comments
Post a comment