Hi, has anyone had any luck getting font awesome to work with a CLI-based project?
Apart from installing the packages via npm, I’m a bit clueless on how to proceed. I’m guessing there is some configuration that has to be done in aurelia.json in order for the FA-libraries to be included, but I’m not sure how to specify this.
Not sure if you know cli provided copyFiles especially for dealing with fonts and other static resources, you don’t need an extra task. It is documented.
That SO page is bit old, before copyFiles was introduced.
I have this working with SVG. Your view-model will look something like this.
import fontawesome from "@fortawesome/fontawesome";
import light from "@fortawesome/fontawesome-pro-light";
fontawesome.library.add(light.faSearch);
Your aurelia.json will look like this. You do need the first one in this, the rest will be optional depending on what icons you need. You do NOT need to add anything to prepend or have any copy tasks
@jrogalan
It works with the copyFiles. But the example is buggy. I added a comment in stack-overflow:
Looking into the font-awesome css file the target directory should be “font-awesome/fonts/” instead of “fonts/”. That worked for me… but the hint with copyFiles is very good and helped a lot –