Better support for SVG dataURL/inline in GraphQL (to reduce requests) #30042
Unanswered
mwt
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How many of you have gotten the following error at some point:
This error appears when you treat an SVG like any other image in Gatsby and try to insert it into your document using the standard fluid image workflow. The warning is actually great. It's highly descriptive and tells you how to get around the problem.
However, the solution of using publicURLs is not ideal. In many cases, the SVG is very small and should either be in-lined or converted to a data URL to reduce the number of requests. Adding a
content
ordataURL
tag to GraphQL for files of theimage/svg+xml
mediatype (or even for all files) would help a lot with this.The simplest solution might be to add a
dataURL
flag for all files. It's possible that there is already a great way to do this that I don't know about. I only started using Gatsby/react two days ago. So, I don't know a lot of the tricks.Beta Was this translation helpful? Give feedback.
All reactions