Font Awesome v5 in a CLI based, non-webpack project


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.


fa5 has 2 ways to be used. The easiest way is to use the “SVG with JS”. For that, just add the js to the “prepend” section before loading requirejs.

"prepend": [
  // ...

Beware fa5 “SVG with JS” mutates the DOM, you need special treatment if you bind changeable class.


Thanks, I ended up installing the @fortawesome/fontawesome-free-webfonts package and using a custom task to copy fonts and css files.



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";

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

            "name": "@fortawesome/fontawesome",
            "path": "../node_modules/@fortawesome/fontawesome",
            "main": "index"
            "name": "@fortawesome/fontawesome-free-regular",
            "path": "../node_modules/@fortawesome/fontawesome-free-regular",
            "main": "index"
            "name": "@fortawesome/fontawesome-free-solid",
            "path": "../node_modules/@fortawesome/fontawesome-free-solid",
            "main": "index"
            "name": "@fortawesome/fontawesome-pro-light",
            "path": "../node_modules/@fortawesome/fontawesome-pro-light",
            "main": "index"
            "name": "@fortawesome/fontawesome-free-brands",
            "path": "../node_modules/@fortawesome/fontawesome-free-brands",
            "main": "index"


Hi there @vidar.

You have some working example… The stackoverflow question has not worked for me …