-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
trouble using import.meta.glob
with @sveltejs/enhanced-img
#12213
Comments
You have a number of bugs in your code:
I think you mean
You're missing |
generate_picture_html
function from @sveltejs/enhanced-img
import.meta.glob
with @sveltejs/enhanced-img
I apologize for the typos in the code; my pseudocode often goes unchecked. I'll update the original issue. Regarding the async function, I'm unsure how to handle returning a promise since I'm uncertain about what feature to request at this point. Perhaps a change in the documentation? I'm not sure. |
If you use the |
Sweet! I will give that a try. Thank you for looking into this and the added clarification in the docs PR! I'll let the PR merge auto close this issue; but feel free to close it already if that suits you better. |
Describe the problem
When using
import.meta.glob
as desribed in the docs, there is no way to then easily generate a<picture>
elements from its output, which I need this for SSR / prerendering.I was planning on doing something like this, but unfortunately this does not magically work:
Describe the proposed solution
First I thought of suggesting the
<Img/>
component again, but it is probably sufficient if the package exposed whatever code generates the final picture html code.Alternatives considered
Some crazy shit like importing every asset for every employee one by one, map the imports in an object and then return whatever value vite generates when doing that so enhanced:img can parse it during prerendering and stuff
Importance
i cannot use SvelteKit without it
Additional Information
No response
The text was updated successfully, but these errors were encountered: