can some one tell my why angular cli project is copying graphic files from the assets folder into the root of the output folder?
For example I have a graphic at src/assets/background.jpg, and I reference that graphic from my src/styles.css file:
body {
background-image: url(./assets/background.jpg);
}
Now when I build my project using:
ng build --prod --output-hashing=none --output-path=target/output
I now have the following generated output structure:
target/ouput
...
background.jpg
assets
background.jpg
The css is refernecing the copied version of the background file and everything works, but now I have two copies of the file. How can I reference this file from assets/background.jpg so I don't get two copies?
Thanks; David
Because the idea is that everything you need to deploy will be in the specified output folder. Then you can deploy by copying the output folder to your server.
If the --prod build didn't copy the file, it would not be in the set of output files and would not get deployed without extra steps on your part.
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