Tobija
NuxtImage can't use images from /assets/ directory (when building)
Either I fundamentally don't understand how & when nuxt-image is meant to be used or there are some unintentional behaviours I'm stumbling upon.
Either way I think for now, the most sensible thing for me to do is to use the normal
<img>
component because the project isn't really depending on a lot of nuxt-image funcitonality.7 replies
NuxtImage can't use images from /assets/ directory (when building)
Okay, thank you. Your help is greatly appreciated.
Still I have to admit, if anything I'm getting more confused.
I adjusted the reproduction (https://stackblitz.com/edit/nuxt-starter-6xjdby?file=app.vue) to use the public directory and a nuxt-image preset. It works in dev, and when I build in stackblitz, there's an error concerning sharp (maybe related to https://github.com/nuxt/image/issues/1210) and when I build it on my local machine, the presets just get fully ignored and the original image is displayed.
7 replies
NuxtImage can't use images from /assets/ directory (when building)
okay, so you're telling me, I should just not bother with the
/assets
directory and put all images in the /public
directory when working with the nuxt-image module?
Because with the normal <img>
tag it works and the image file is added to the bundle (with a hash in the file name) and referenced with the correct file name. (That was the behaviour I was initially expecting from NuxtImg as well)7 replies