Angular cli copying files out of the assets folder

Viewed 2639

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

1 Answers
Related