-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Inline SVG elements #45
Comments
Edit: One further question is whether esbuild customizations (like defining a plugin to import SVG as components, such as esbuild-plugin-svgr) should be defined in |
I did some more digging and it looks like this is specified in the default create-figma-plugin/packages/build/src/utilities/build-bundles-async/build-bundles-async.ts Line 116 in 2562363
Anyone have tips on how to change this loader so that I can render the SVGs inline as components? I can't get |
Ok one more update: I took a look at various esbuild plugins and strategies for loading inline SVGs as component imports, but none of them are working. I think this would be a great feature to support in the library, but I'm not experienced enough with esbuild to know how to add the feature. |
@devinhalladay – Thanks for the detailed report, it really helps with understanding the issue you’re facing!
SVGs go in the generated |
That's really helpful info, thank you @yuanqing! And thanks for this library in general — it's been so helpful and I'm using it to build this. I'm going to go ahead and just create regular components for my icons. I might try out the Thanks again :) |
Hi! I've followed the docs for importing image assets (in this case an svg file) but I'm still having trouble. What I'm trying to achieve is
import IconName from './assets/icon.svg
but so far I've only been able to output a base64 string. Is this an issue with this package, or Preact?I've tried adding the following type definitions to no avail:
Is there a built-in way for me to import SVGs and render as inline components? I tried using
preact/compat
as well; I'm wondering if maybe the switch toesbuild
from webpack could be causing this issue?The text was updated successfully, but these errors were encountered: