Allow static import from URL #27756
Replies: 2 comments
-
@timneutkens I don't see how it could be re-implemented soon if I'm the only one tagged in the discussion, I'm a bit confused, sorry. I thought I was very specific and precise when I provided:
Was there any information missing in the ticket? I'm sorry, it's just I'm very confused about the "discussion" part. When I see something moved there, it's usually to be forgotten... |
Beta Was this translation helpful? Give feedback.
-
I would love this too. Is there a workaround currently to generate StaticImageData from strings of files in public? |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
Before NextJs 11 release, the beta version for static images was using a query parameter in the image URL to flag for static import. See PR #24993
Then it was removed for a nicer solution with the
import
statement. See PR https://github.com/vercel/next.js/pull/25909/filesWhile I agree using
import
statements are the more elegant way to do static images, removing the query parameter option wasn't for the best.For example, if you're content is in Markdown, you're completely screwed as you can't
import
any image beforehand.Describe the solution you'd like
I'd like to have the option of using a query parameter for flagging static images so I can use it with Markdown content.
The code is already done, it's just a matter of bring it back.
There was discussions about the parameter itself,
s
, being potentially conflicting with other 3rd party services. This can be solved by giving it a more unique name, there's no need to use such a short parameter...Describe alternatives you've considered
There is no other alternative I can think of.
Unless there's another way to import static images directly from Markdown content, the best available solution was what was removed before the release of NextJs 11.
Beta Was this translation helpful? Give feedback.
All reactions