ElMassimo / vite-plugin-image-presets

🖼 Image Presets for Vite.js apps
https://image-presets.netlify.app/
MIT License
250 stars 5 forks source link

enhancement: string as the default export if the preset only defines srcset #2

Closed ElMassimo closed 2 years ago

ElMassimo commented 2 years ago

Description 📖

Currently the default export for preset imports is ImageSource[]. This allows presets to define additional source tags, with different formats, conditional widths and densities, etc.

For presets that define a single ImageSource that only contains srcsets, it would be convenient for the default export to be a string.

That would make it work out of the box in img and source tags in HTML and Vue SFCs, where src and srcset are already extracted as imports.