feat: support prerendering static images#614
Conversation
✅ Deploy Preview for nuxt-image-v1 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
Hey, are you making progress on this? Do you know when this will be released? |
|
@pi0 Happy to help test this out once it's merged. Or if there's a way to install Nuxt image from PR / commit hash. |
|
Attempted to continue some of the work here #629 . Playground seems to be working locally but my knowledge of the Nuxt framework isn't that deep, so I defer to the Nuxt team on whether it is useful. |
|
If it works, merge it |
|
Related SO question: https://stackoverflow.com/q/74178950/8816585 |
|
++. would be great to get this in when possible |
|
Also noticed that because the Example Working: Example Broken: Attempted to fix here by changing IPX to use & (not sure if this is the best way) and updated the playground to check for it: e78cb9c (part of PR #629) Edit: Replaced with the underscore character "_" for the joinWith value for cleaner directory names. |
|
@fayazara Depending on how badly you need it, you could move @nuxt/image-edge folder from node_modules into your own Disclaimer: Before I get a lot of thumbs down, I'm not recommending this as a good or long-term solution. Since you'll have to undo these changes later to revert back to the main package. The best thing may be to wait for @pi0 since I noticed several other things that weren't quite ready yet (e.g. using the |
@jimhlad <img
sizes="(max-width: 1400px) 100vw, 1400px"
srcset="
/images/home/hero/dashboard-app_p265ea_c_scale,w_200.png 200w,
/images/home/hero/dashboard-app_p265ea_c_scale,w_499.png 499w,
/images/home/hero/dashboard-app_p265ea_c_scale,w_709.png 709w,
/images/home/hero/dashboard-app_p265ea_c_scale,w_912.png 912w,
/images/home/hero/dashboard-app_p265ea_c_scale,w_1084.png 1084w,
/images/home/hero/dashboard-app_p265ea_c_scale,w_1400.png 1400w
"
src="/images/home/hero/dashboard-app_p265ea_c_scale,w_1400.png"
alt="Dashboard"
class="rounded-lg container-shadow"
/>Production build breaks when I run ERROR [vite]: Rollup failed to resolve import "w_200.png" from "components/Home/DashboardPreview.vue". 23:59:04 |
|
Hmmm not sure then. I'm using the Then |
@jimhlad turns out it's a bug in vite, if URLs have a comma in them, it wont get resolved. |
|
Waiting for this PR like christmas 🎅 |
I hope it comes before christmas |
|
please release this feature 🙏 |
|
I'm sorry, what is preventing this PR from being merged? |
|
Please make it work on static generation :) |
|
Is this live already? I just created a project with Nuxt Content + Nuxt Image, and all the images in my markdown files returning a 404 error when doing |
With this PR we add
nuxi generatesupport for Nuxt 3 images to be optimized on build time.TODO: Find a more stable way set ipx images path during prerendering