next-optimized-images icon indicating copy to clipboard operation
next-optimized-images copied to clipboard

[Canary] Feature request: enable lazy loading from images.config.js

Open Nick-Mazuk opened this issue 4 years ago • 0 comments

More often than not for me, images should be lazy-loaded. So it would be great if we could make lazy loading images the default.

Of course, it's already possible to lazy load images with your plugin with

<Img src={require('filepath')} loading='lazy' />

But if we could set it as the default in the config, it would eliminate lots of extra work! Here's one idea for the syntax:

// images.config.js
module.exports = {
    default: {
        loading: 'lazy',
    },
}

That way, it matches up with the syntax for the other config options.

Thanks!

Nick-Mazuk avatar Aug 29 '20 00:08 Nick-Mazuk