I'm currently working on optimizing Largest Contentful Paint in my nuxt app project, and I need to preload some images from the asset folder. I already tried using nuxt image, but it's currently not working on my end due to not having static as the target and SSR is set to false. I can't change this configuration, as it is needed in the other modules.
I tried putting a link preloader in the head inside the page, but it doesn't seem to work with the LCP error. This specific image is currently been pointed out as one of the causes of the LCP from the lighthouse.
head() {
return {
link: [
{ rel: 'preload', as: 'image', href: '_nuxt/client/assets/images/some-image.png' }
]
}
Is there any way to preload images in the asset folder? Or ways to optimize LCP with images from the asset folder, which is handled by webpack?