Skip to content
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

Building static images ahead of time for dynmaic retrieval in code [canary] #187

Open
guy-kdm opened this issue Aug 9, 2020 · 2 comments

Comments

@guy-kdm
Copy link

guy-kdm commented Aug 9, 2020

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?

@cyrilwanner
Copy link
Owner

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.

@guy-kdm
Copy link
Author

guy-kdm commented Aug 11, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants