Hi,
I installed FontAwesome5 via npm. Now i have the following structure in node_modules:
Which files do i need from those folders if i want to use all icons? Please also explain those folders because the "fontawesome" folder includes js and css but no fonts and no svg's in js.
The other folder include index.js and shakable.js. What is shakable.js?
thanks and best wishes,
Patrick
Hi!
Thanks for being part of the Font Awesome Community.
Does this help?
Thanks @tagliala but no. I've read the documentation before and it's still ned 100% clear for me.
@eberhapa I was able to pull in the entire library with the following:
import fontawesome from '@fortawesome/fontawesome'
import brands from '@fortawesome/fontawesome-free-brands'
import light from '@fortawesome/fontawesome-pro-light'
import regular from '@fortawesome/fontawesome-pro-regular'
import solid from '@fortawesome/fontawesome-pro-solid'
fontawesome.library.add(brands, light, regular, solid)
Then just make sure that you're compiled javascript file is included. The javascript will search for the correct classes and then make the switch to SVG for you.
Doing it this way, and not specifying which icon from the packs, will significantly bloat your compiled javascript and is not recommended for a production environment. Instead, if you do this for development, just keep track of which icons you end up using and selectively call those in.
@eberhapa does this address your question?
Sorry, I was busy and got no notification. Yes, it's clear now. Thats the way to use it with ES. Without ES I just need the fontawesome.min.js and the [regular/brands/solid/light].js files or the fontawesome-all.min.js. Thanks for helping out.
Most helpful comment
@eberhapa I was able to pull in the entire library with the following:
Then just make sure that you're compiled javascript file is included. The javascript will search for the correct classes and then make the switch to SVG for you.
Doing it this way, and not specifying which icon from the packs, will significantly bloat your compiled javascript and is not recommended for a production environment. Instead, if you do this for development, just keep track of which icons you end up using and selectively call those in.