Using Static Images in Aurelia


Why do it give me this situation?

Why some images is import from physic file(“dist/…” and other are imported from string(data:image/png/…")?!

Hope someone could help me, thanks.

1 Like

It is probably because some images are small enough that file loader could inline them into data:.... while the larger images will be copy to dist folder and renamed. You can adjust the threshold in your webpack config to control what is the minimum size requried.

1 Like

Was looking around for the same issue and discovered this thread. That prompted me to do a search and I found this blog showing the options for this.

1 Like

I found another solution… I think it’s worse than your.
I put all images and content in dist/images has a tutorial said.
Than I can call images from “/dist/images/image.png” … now I have not those files with a “crypted” name but all content stay in the directory images and in the html there is the correct path.

For the moment I’m ok.

Thank you anyway,