I have font-awesome in my node_modules folder so I try to import it in my main .scss file like so:
@import \"../../node_modules/font-awesome/scss/font-awesom
This is how it worked for me, the trick is to set $fa-font-path
to the path of the fonts as following.
$fa-font-path: "~@fortawesome/fontawesome-free/webfonts/";
@import '~@fortawesome/fontawesome-free/scss/fontawesome.scss';
@import '~@fortawesome/fontawesome-free/scss/solid.scss';
@import '~@fortawesome/fontawesome-free/scss/brands.scss';
Note: Please check your fonts folder in node_modules
in my case it is @fortawesome/fontawesome-free
v.4 (symofony 4 + webpack)
$fa-font-path: "~components-font-awesome/webfonts";
@import '~components-font-awesome/scss/fa-brands';
@import '~components-font-awesome/scss/fa-regular';
@import '~components-font-awesome/scss/fa-solid';
@import '~components-font-awesome/scss/fontawesome';
For Version 5.14, the following worked for me:
$fa-font-path : '../node_modules/@fortawesome/fontawesome-free/webfonts';
@import "../node_modules/@fortawesome/fontawesome-free/scss/solid";
@import "../node_modules/@fortawesome/fontawesome-free/scss/brands";
@import "../node_modules/@fortawesome/fontawesome-free/scss/fontawesome";