ElMassimo / vite-plugin-image-presets

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

`&src` argument gives bad `/@imagepresets/[id].[ext]` path (vite 5) #31

Closed rikki-ts closed 8 months ago

rikki-ts commented 9 months ago

the import for the file in question: import rebrandedImage from "../../../images/example.jpeg?preset=800&src"

Screenshot 2024-01-22 at 12 33 37

the preset:

imagePresets({
     800: widthPreset({
          widths: [800],
          loading: "lazy",
          formats: {
            png: { quality: 70 },
            jpeg: { quality: 70 },
          },
      })
})

what am i missing?

vite: 5.0.8 sharp: 0.33.2

rikki-ts commented 9 months ago

updating the title as seeing this is the exposed virtual id, I am assuming that this is resulting from a breaking api change in vite 5

rikki-ts commented 9 months ago

I think it's related to this change: https://github.com/vitejs/vite/pull/14818

rikki-ts commented 8 months ago

Apologies, I found I had this image with any vite plugin that touched images, so i think it had something to do with my install or config approach