I followed the recommended steps on Fontawesome's official site to install the fontawesome library. I used the following command:
npm install --save-dev @fortawesome/fontawesome-free
For production purposes, I included the following code in my index.html file:
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.0/css/all.css">
When running ng serve
, the icons do not display when offline.
To make sure the icons show up offline as well, I imported the all.css
file into my style.css
like this:
@import "../node_modules/@fortawesome/fontawesome-free/css/all.css";
Running ng build --prod
displays the icons fine when online, but how can I see them when using ng serve
and offline?
Here is a snippet of my package.json
:
{
"name": "test-app",
"version": "0.0.1",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build"
},
"private": true,
"dependencies": {
"@angular/animations": "^7.2.5",
...
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.13.2",
...
"@fortawesome/fontawesome-free": "^5.8.0",
...
}
}
This setup is being used in an Angular 7 project.