next-optimized-images
next-optimized-images copied to clipboard
Building static images ahead of time for dynmaic retrieval in code [canary]
I want to require images using a function that constructs the image name. I know all the image URLs that would be required in advance. Should I use a code-gen plugin to create a code file with all the URLs required() and than let the plugin do the rest?
This is a planned feature of the next major version (#120), but I haven't started on that particular feature yet. So until that feature is out, I think your solution would be the best way to solve that problem.
Cool, since I need to dynamically create the image url, I'm back to building a sharp script for now. This needs to create images with sizes in sync with the layout (and add a hash ext). I'd love there to be a standard way for Next.js to keep that "image script config" colocated in the layout, while allowing me to dynamically build the URL.