Unable to optimize any image in Static folder without using "require" #301
Unanswered
ManasMadrecha
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Also interested in this answer @ManasMadrecha. Curious have you also tried using this module in a standard page component and not via content module? Also, by design files that will not change would stay in the static folder and files that will be modified in some capacity e.g. nuxt-optimized-images would go in the assets folder. There is an open issue now being discussed about processing images within the Content Module here. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using Nuxt Content. So, to avoid rebuilding every time I add new images or post, I have all my images in Static folder (arranged blog post-wise).
So, in my Individual blog post page, for my Featured image:
I do not use
<img :src="require('~/assets/image.jpg)?webp" />
Rather, I use
<img :src="`/images/blog/${post.id}/${post.featured.image}.jpg?webp" />
Then, when I
nuxt generate
, I am unable to see any optimization. Even in my image URL,?webp
stays in the end, which means nothing happened to the image.Is it because this module only optimizes images in Assets folder and not in Static folder?
Beta Was this translation helpful? Give feedback.
All reactions