There are many, many ways to use FontAwesome. The simplest way, which is used in MXCuBE is to install the @fortawesome/fontawesome-free package and import the @fortawesome/fontawesome-free/css/all.min.css stylesheet. This basically provides a web font with all of FontAwesome's free icons, which can then be used in HTML with <i class="fas fa-cog" />.
This is far from the best way to use FontAwesome since it means all the free icons are loaded even if they're not used, but it has the advantage of being very simple to set up and work with. So I'm not changing it (it would be way to much work anyway).
The problem was that MXCuBE was also kinda trying to set up FontAwesome in two other ways:
With the React package @fortawesome/react-fontawesome, which allows rendering icons in JSX with <FontAwesomeIcon icon={faHouse} /> — I didn't find any use of this technique, so I've removed the dependency from package.json.
With the JavaScript API provided by the @fortawesome/fontawesome-svg-core package, combined with the three free icon packages @fortawesome/free-<kind>-svg-icons — the index.js file contained some imports and initialisation code for this technique, but the icons registered in this way were not being used anywhere, so I've removed the relevant dependencies and init code.
There are many, many ways to use FontAwesome. The simplest way, which is used in MXCuBE is to install the
@fortawesome/fontawesome-free
package and import the@fortawesome/fontawesome-free/css/all.min.css
stylesheet. This basically provides a web font with all of FontAwesome's free icons, which can then be used in HTML with<i class="fas fa-cog" />
.This is far from the best way to use FontAwesome since it means all the free icons are loaded even if they're not used, but it has the advantage of being very simple to set up and work with. So I'm not changing it (it would be way to much work anyway).
The problem was that MXCuBE was also kinda trying to set up FontAwesome in two other ways:
@fortawesome/react-fontawesome
, which allows rendering icons in JSX with<FontAwesomeIcon icon={faHouse} />
— I didn't find any use of this technique, so I've removed the dependency frompackage.json
.@fortawesome/fontawesome-svg-core
package, combined with the three free icon packages@fortawesome/free-<kind>-svg-icons
— theindex.js
file contained some imports and initialisation code for this technique, but the icons registered in this way were not being used anywhere, so I've removed the relevant dependencies and init code.