I am getting the impression that adding Font Awesome to a CLI webpack project is not that straight forward. I have seen a question along these lines on SO but it referred build.js which I dont have along with gulp which I dont use.
Is there a way of adding Font Awesome to an Aurelia project where I have webpack and package.json in the CLI ASP.NET option?
au new myProject , >3-custom >3-webpack >1 Web >1 Babel >…N/A
npm install font-awesome --save-dev
or
yarn add font-awesome
au-cli uses yarn by default if you have installed yarn
make sure you have got css loaders in webpack.config.js,
when using au-cli to generate a webpack it adds css loader in module section automatically
module: {
:,
{
test: /.css$/i,
issuer: [{ test: /.html$/i }],
// CSS required in templates cannot be extracted safely
// because Aurelia would try to require it again in runtime
use: cssRules
},
:
}
in app.js:
import 'font-awesome/css/font-awesome.css';
export class App {
constructor() {
}
}
in app.html:
<template>
< i class=“fa fa-camera-retro fa-5x”> fa-5x
</template>
au build
au run -w
Note: step 4 is most likely, what you are missing. You need to require or import the css, that way
webpack recognizes it and bundles it