Open albertpeiro opened 4 years ago
Same goes for ?webp
. I'm unable to utilise the functionality via Sass files
Same for me for ?webp
. Any update?
I also can neither resize background-image in filename.module.scss
, nor convert it to webp. Any of
background-image: url('../public/images/hero-bg.png?webp');
background-image: url('../public/images/hero-bg.png?resize&size=500');
results in the full jpeg image (i.e. localhost:3000/_next/static/images/hero-bg-3ffba3cef92d0972f13f317d74e1bcab.png).
This closed issue mentions that at least converting to webp should be possible.
This is my next.config.js
:
const withPlugins = require('next-compose-plugins');
const optimizedImages = require('next-optimized-images');
const responsiveLoaderSharp = require('responsive-loader/sharp');
module.exports = withPlugins([
[optimizedImages, {
responsive: {
adapter: responsiveLoaderSharp,
sizes: [300, 320, 640, 960, 1200, 1800, 2400],
placeholder: true,
placeholderSize: 40,
},
optimizeImagesInDev: true,
}],
]);
I couldn't find anywhere a mention to this not working so I assumed this should work but please correct me if I'm wrong. Also THANK YOU for this library - it's awesome.
Resizing via url params works when I use it with
require
. It doesn't seem to work from scss files though.Image size remains 2048 when opening it
I'm on: