Skip to content

Instantly share code, notes, and snippets.

@Pigamo
Last active November 7, 2024 09:16
Show Gist options
  • Save Pigamo/6ad9d769a23bbdc07a9ef6f7226cbb55 to your computer and use it in GitHub Desktop.
Save Pigamo/6ad9d769a23bbdc07a9ef6f7226cbb55 to your computer and use it in GitHub Desktop.
Imports multiple images from a folder using Vite globs
const gallery = Object.values(import.meta.glob('@assets/*.{png,jpg,jpeg,PNG,JPEG}', { eager: true, as: 'url' }))
@PullRequestTimeout
Copy link

Does anyone know how to use this in SvelteKit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment