I am trying to display a PNG image located at assets/images/logo.png
And bundled into priv/static/assets/images/logo.js, with this esbuild config:
--bundle --target=es2017 --outdir=../priv/static/assets --loader:.png=dataurl --external:/fonts/* --external:/images/*)
I added ‘–loader:.png=dataurl’ because esbuild said it didn’t know how to handle .PNG files, this then bundles the png into a .js file.
I think I might be going about this problem the wrong way.
My heex template:
<a href="https://www.company.com/" class="phx-logo">
<img src={Routes.static_path(@conn, "/images/logo.js")} alt="Company Logo"
style="width:80px;height:80px"/>
</a>
How can I properly display this PNG image?