I'm attempting to dynamically import fortawesome icons in my sveltekit project, and struggling with the proper format. This is my test:
onMount(async () => { let icons = ['faGear', 'faCarrot', 'faHandSparkle'] for (const iconName of icons) { await import(`@fortawesome/pro-regular-svg-icons/${iconName}.js`) } })
I get a vite error that this import can't be analyzed, and to provide an absolute path. I'm not sure how to point to these using an absolute path, or if we can even import js libs like this. Anyone know how to resolve? Thank you