-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support import.meta.glob #24
Comments
I'll try to see if this is possible once #17 is properly working, at least on |
Alright, I've been digging around a bit in the vitejs source code and it seems that they are passing the full url to fast-glob, so importing your example So it seems like for now glob imports unfortunately don't work, no. :/ |
Thanks for investigating the issue. That sucks.. because in several occasions dynamic |
Yeah that's very annoying yeah. |
I've already deleted my prototype using dynamic imports. Tomorrow I'll try to put together repo with imports that don't resolve so we can eventually raise it as an issue at Vite. |
@JonasKruckenberg I had a look at the Vite source code and found that when using the const images = import.meta.globEager("./*.jpg", {as: "w=250"}); However, this does not seem to work in practice, transforms are not applied. |
@palle-k I think you'd want to use |
This I find is also a very good template: sveltejs/kit#241 (comment) |
I've added |
It'd be awesome if we could leverage glob import to for example import all images in a directory AND apply transformations on all of them.
I image it'd be used just like this:
The exported object might look like this:
If we use
globEager
instead ofglob
we would get themetadata
object instead of() => Promise<metadata>
.The text was updated successfully, but these errors were encountered: