Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Angular CLI (1.3+) How can I ensure that my web.config file outputs to my 'dist' directory

In order to copy any file like a favicon.ico or a web.config from my Angular CLI project out to my dist folder upon running my production build command: ng build --env=prod, where do I have to put my file that I want copied and do I need to reference it in my .angular-cli.json file?

like image 803
Eric Bishard Avatar asked Aug 23 '17 16:08

Eric Bishard


1 Answers

A few things you must remember when outputting files to your dist directory.

Ensure that the file you want exported already exists in your src directory. If you have both a favicon.ico and a web.config file that you want to output to the root of the dist directory they need to be in the root of your src directory.

Next you need to make a change to .angular-cli.json like so:

"apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico",
        "web.config"
      ],
      ...
    }
  ],   
like image 170
Eric Bishard Avatar answered Sep 20 '22 13:09

Eric Bishard