enhanced:img, handling images in Svelte and Kit
summary
SvelteKit’s Enhanced Image preprocessor automatically converts Vite asset images to AVIF and WebP with hashed filenames for long caching, generates multiple dimensions including 2x for high-density displays, and auto-inserts width and height to prevent layout shift. It accepts Vite asset paths and mustache-tagged sources, supports import.meta.glob for batch processing, and can shrink a mobile image example down to ~1% of the original bytes. The output is a single string replacement for fast DOM insertion and hydration.
AI-written summary · about
