Closed ambigos1 closed 1 year ago
This is a build-time plugin and dynamic imports are runtime, so I can't see how this would ever work.
To expand a little: If you wan't to use your SVG's as dynamic imports, convert them manually (statically) to Svelte components on beforehand.
There are probably tools out there for scripting stuff like this.
Hi. I would like to add svg icon dynamically based on parameters that the component is getting by its inputs.
Input example: socials: [ { link: 'XXX', url: '../images/icons/instagram-brands.svg' }, { link: 'XXX', url: '../images/icons/tiktok-brands.svg' }, { link: 'XXX', url: '../images/icons/whatsapp-brands.svg' }, { link: 'https://t.me/InstBlast', url: '../images/icons/telegram-plane-brands.svg' } ]
I tried dynamic import like the example above but the icons is not displayed
Any suggestions How can I make it work?
Thanks.