Feat/static generation
This is a modified version of @pi0 's PR for static image generation (took the heavy lifting from there).
Would be interested to get a second pair of eyes from @danielroe or someone on the Nuxt team.
P.S. Not sure if creating a separate PR was the best approach. Feel free to close this out if it's way off the mark or if modifying the original PR is easier. Thanks!
Deploy request for nuxt-image-v1 pending review.
Visit the deploys page to approve it
| Name | Link |
|---|---|
| Latest commit | bcd2b741e738f4227f1ce734bb462d34e12802e3 |
Updated to address issue outlined here: https://github.com/nuxt/image/pull/614#issuecomment-1299377666
Updated to fix issue with srcset image generation
This works great. Please merge asap
Given that #614 has seen some activity today by @pi0 , which one should be merged?
Thanks for your work on this @jimhlad please keep doing this ❤️ For now, I went with #614 solution.
Thanks @pi0 .
Does it work with multiple formatters at the same time though (e.g. width, height and quality)?
I recall I had to add trim() here to fix something (I forget what it was though):
...(sizes.value.srcset || '').split(',').map(s => s.trim().split(' ')[0])
Also had some issues using process in the <nuxt-img> component. But maybe fixed now 😄
Feel free to open PR for other issues ❤️