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?
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"
],
...
}
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With