Closed
Description
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
OS X El Capitan
- Versions. Please run
ng --version
. If there's nothing outputted, please run
in a Terminal:node --version
and paste the result here:
angular-cli: 1.0.0-beta.14
node: 6.3.0
os: darwin x64
- Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
Create new project with ng new test-project
Add images folder to src (and you can add to src/app, doesn't matter).
Reference image in app.component.html
<img src="images/image.png" alt="test" />
Build project with ng build -prod
- The log given by the failure. Normally this include a stack trace and some
more information.
Image is not being bundled into dist folder and is not loading producing 404 error. - Mention any other details that might be useful.
Problem is reproduced withng build -prod
and is not reproduced withng serve -prod
.
github repo showing problem: https://github.com/alexsorokoletov/angular-cli-image-loader-problem
I am not sure if this is a problem of webpack html loader plugin or issue related to it's configuration or I am doing something wrong.
For a workaround I am using assets
folder and put all images there.
However, it is strange to me keeping some images in assets and some (that are mentioned in the css files) inside the webpack bundle
Thanks! We'll be in touch soon.