Problem
After generating a workspace with the new @angular/cli@18
package, I am unable to determine how to reference image assets placed in the /public
folder.
This did not seem to be an issue with @angular/cli@17
workspaces but they used a different asset folder name & location.
Background
For comparison, v17 created a structure similar to this:
workspace-name
|
projects
|
application-name
|
src
|
assets
Then, from a template you could reference an asset like so: <img src="assets/imagename.webp">
However, in v18 the created structure is generated as follows:
workspace-name
|
projects
|
application-name
|
public
src
It appears that the assets are intended to go in the public folder but I have tried various permutations of pathing to reference these assets to no avail. Also, doing an ng build application-name does not appear to copy the files in the public folder over to the dist so maybe this has something to do with it.
It should be noted that when an app is generated without a workspace, I am able to reference assets simply by using asset-name.webp
without issue.
Question
Is this a bug with the new builder or is there a new way to reference these assets or some additional configuration that needs to be done now that they are located in a different folder?