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

前端 未结 8 2142
梦谈多话
梦谈多话 2020-11-30 08:31

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 insta
8条回答
  •  再見小時候
    2020-11-30 09:01

    Not actually answering to your question of how to integrate Font Awesome in your application using NPM, but there is an alternative, clean way to get it in your application: using the CDN.

    As mentioned in other answers, Aurlia currently doesn't support bundling resources other than js, css and html out-of-the-box using the CLI. There's a lot of discussion about this subject, and there are several, mostly hacky, workarounds, like some suggested here.

    Rob Eisenberg says he's planning on getting it properly integrated in the Aurelia CLI, but he considers it low priority because there's a simple workaround. To quote him:

    Of course there is interest in addressing this. However, it's lower priority than other things on the list for the CLI, in part because a simple link tag will fix the problem and is much easier than the work we would have to do to solve this inside the CLI.

    Source: https://github.com/aurelia/cli/issues/248#issuecomment-254254995

    1. Get your unique CDN link mailed here: http://fontawesome.io/get-started/
    2. Include this link in the head of your index html file
    3. Don't forget to remove everything you might have already added to try to get it working: the npm package (and its reference in your package.json), the reference in your aurelia.json file, any custom tasks you might have created, any tags,...

提交回复
热议问题