Aug 22, 2025 • Bookmark
🔖 Bookmarked:
Importing images dynamically from inside the lib folder in Sveltekithttps://stackoverflow.com/a/77934957
Storing images in the static folder is usually the go-to solution especially if it is dynamic (loaded from a CMS or something), but this means you lose out on Vite’s image optimizations. I always have to come back to this answer to figure out how to load them from inside the lib or src folders.
