DEV Community

Discussion on: Gridsome g-images with dynamic paths

Collapse
 
mtlynch profile image
Michael Lynch

Thanks for this tip! It worked for me, but webpack-bundle-analyzer revealed that all the image references were bloating my JS bundle.

I don't know of a better alternative for loading dynamic paths in g-image. What I decided to do instead is pre-process my source to add the paths I need. My source is all markdown, so I'm just adding an extra field to my frontmatter. I'd rather not have a field that could be derived from other frontmatter fields, but I can't find a better solution without degrading performance.

Collapse
 
giuliacardieri profile image
Giulia Cardieri

I'm facing the same issue. I'm considering removing all g-image references because I have lots of images and the website is taking way too long on the initial load. Did anyone find a solution that works for dynamic images and keeps the performance in a good place? Thank you all for your insights on this issue.