Last active
November 7, 2024 09:16
-
-
Save Pigamo/6ad9d769a23bbdc07a9ef6f7226cbb55 to your computer and use it in GitHub Desktop.
Imports multiple images from a folder using Vite globs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gallery = Object.values(import.meta.glob('@assets/*.{png,jpg,jpeg,PNG,JPEG}', { eager: true, as: 'url' })) |
hey looks like you guys figured it out! maybe i can update the gist to
reflect it. I realized too it wasn’t very comprehensive in it’s import
allowance.
…On Fri, Feb 24, 2023 at 12:15 PM Tim ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
The issue is the path to the image, I've posted a question on Vite's
discussion thing on GitHub
<vitejs/vite#12191> .
If you find or remember anything, tell me!
Thank you dude
—
Reply to this email directly, view it on GitHub
<https://gist.github.com/6ad9d769a23bbdc07a9ef6f7226cbb55#gistcomment-4482736>
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN3M4JMZMDY66XOS6RRFGRLWZDUCXBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTCMZRGY3TCMBVU52HE2LHM5SXFJTDOJSWC5DF>
.
You are receiving this email because you authored the thread.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>
.
Thanks for asking the right questions. I updated the gist to reflect the answer!
The issue is the path to the image, I've posted a question on Vite's discussion thing on GitHub . If you find or remember anything, tell me! Thank you dude
Thanks @mkxto
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
The issue is the path to the image, I've posted a question on Vite's discussion thing on GitHub .
If you find or remember anything, tell me!
Thank you dude