My Angular2 application was originally built using angular-cli (v 1.0.0) and webpack2.
Within a component, I had the ability to reference an image like so:
<div class="country-flag">
<img [src]="src/assets/flags/32/jp.png" [width]="flagIconSize" [height]="flagIconSize" />
</div>
All images were stored in the default assets folder structure:
Root
|--src
|--app
|--assets
|--flags
|--32
|-- ...png
And these assets were properly registered in the .angular-cli.json file:
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
]
Initially, everything worked fine with displaying the images. However, after updating my packages to the latest versions today:
- Angular 4.1.2
- Angular-CLI 1.0.3
I started encountering 404 errors for every image within the assets folder, even though the paths appeared to be correct:
GET http://localhost:4200/src/assets/flags/32/jp.png 404 (Not Found)
Have there been any changes in how path resolution works with these newer releases?