Closed idank closed 1 year ago
In Vite 2 there was no way to pass "parameters" to glob imports.
However, in Vite 4, it's now possible to use as
to provide the parameters, and this works as expected:
import type { ImageAttrs } from 'vite-plugin-image-presets'
const images = import.meta.glob<ImageAttrs[]>("@/assets/images/**", {
eager: true,
as: "preset=default",
import: 'default',
})
I have a "gallery" of images which gets loaded like so:
Is it possible to have the plugin process the images that get imported in this way? Thanks!