alphapeter / fa-svelte

Font Awesome 5 for svelte.js
MIT License
71 stars 3 forks source link

Importing Multiple Icons #10

Closed JHethDev closed 4 years ago

JHethDev commented 4 years ago

I might have missed something in the documentation but it looks like the only way to import multiple icons is with multiple import statements.

import { faCircle } from '@fortawesome/free-solid-svg-icons/faCircle';
import { faHome } from '@fortawesome/free-solid-svg-icons/faHome';

Is this really the case and are there any plans to make a single import statement in the near future for this component?

alphapeter commented 4 years ago

It shouldn't really matter how you import the icons when using this component.

How did you try to do it? Did you try like this?
import { faCircle , faHome } from "@fortawesome/free-solid-svg-icons";?

Personally I would not import directly from free-solid-svg-icon since it will dramatically increase the bundle size if you don't use any tree shaking algorithm.

JHethDev commented 4 years ago

I think I did try that method to no avail, not a huge deal to have multiple import statements but might be nice to have an official/recommended way of doing it in the docs. Closing this, thanks.