MaYaN MaYaN - 3 months ago 299
Javascript Question

How can I add Font Awesome to my Aurelia project using npm?

I have been following the Contact Manager tutorial and would like to add Font Awesome to the project. Here's what I have done so far:


  • npm install Font-Awesome --save

  • Added the following to
    aurelia.json
    under the dependencies array of the
    vendor-bundle.js
    :






...
{
"name": "font-awesome",
"path": "../node_modules/font-awesome",
"resources": [
"css/font-awesome.min.css"
]
},
...


But when running
au run --watch
I get the error:


error
C:\Users\node_modules\font-awesome.js


Why is it looking for the .js file?

Answer

Funny I was trying to get the same thing working this morning. This is all I had to do in my aurelia.json dependencies for it to work:

      {
        "name": "font-awesome",
        "path": "../node_modules/font-awesome/",
        "main": "",
        "resources": [
          "css/font-awesome.min.css"
        ]
      },

Then in my html I had:

<require from="font-awesome/css/font-awesome.min.css"></require>
Comments