juliomrqz/nuxt-optimized-images

Migrate to responsive-images-loader instead of responsive-loader

avxkim opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Currently responsive-loader doesn't allow us to resize a webp image, like this: ~/assets/images/image.jpg?webp&size=64, this would just resize an image, but won't convert to a webp format.

Describe the solution you'd like
Migrate to responsive-images-loader instead of deprecated/unmaintainable responsive-loader.

There's suggestions already: #2 (comment)

Current workaround to make resize work with webp:

First, you need to install responsive-images-loader as alias to responsive-loader and sharp:

yarn add -D responsive-loader@npm:responsive-images-loader sharp

Then you can use it:

require('~/assets/images/logo.jpg?format=webp&size=64')

Notice. You need to use ?format=webp&size=64 instead of just ?webp&size=64

@juliomrqz ping

The responsive-loader v2.0.0 and responsive-images-loader are the same now. But you need to use ?format=webp&size=64 also.
https://github.com/dazuaz/responsive-loader/issues/104

@hug0hq indeed, it works with responsive-loader now, because the old maintainer recently transferred repo to duaz. Well, we just need to update the docs then, about ?format=webp