I’m experiencing an issue with my Angular 18 project after running a production build. The images in the assets
folder and Font Awesome icons are not displaying when the application is deployed. Everything works perfectly in development mode, but after running ng build --prod
, the assets seem to be missing.
I checked the build paths and confirmed that the paths in my HTML files and CSS are correct.
The assets are correctly referenced under the "assets"
section.
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "/assets"
},
{
"glob": "favicon.ico",
"input": "src",
"output": "/"
},
{
"glob": "manifest.webmanifest",
"input": "src",
"output": "/"
}
],
I used various build flags and options like --base-href
and --output-hashing
, but nothing seems to work.
The issue came in all browsers.
Angular Version: 18.0.0
Node Version: 20.9.0