public directory. What happens when you reference /logo.png in your component?Astro treats the public directory as a place for static assets. These files are copied as-is to the build output and served at the root URL path. So referencing /logo.png works without importing.
banner.jpg inside the public folder. Which is the correct way to display it in an Astro component?Files in the public folder are served from the root URL. So you reference them with a path starting with /. Relative paths including public folder name won't work.
icon.svg inside src/assets and referenced it as /icon.svg in your component. Why does it fail to load?Astro only serves files from the public directory as static assets accessible by URL. Files inside src/assets are part of source code and need to be imported or handled differently.
public directory?Astro treats the public folder as a place for static files. It copies them as-is to the build output so they can be served directly by the web server.
public folder. If you change the image file in public and rebuild, what happens to the component's rendered output?Since the image URL remains the same, the browser loads the updated file after rebuild. Astro does not track public files as reactive state, but rebuilding updates the served files.