Font Awesome Pro is a premium icon set and toolkit that offers over 8,000 vector icons and social logos for your website. You can use them to enhance your design, add interactivity, and create stunning effects. In this guide, we will show you how to set up Font Awesome Pro with Gulp and Webpack, two build tools in Metronic for web development.
fontawesome-pro-6.4.0-web.zip
file and place it in this folder: src/plugins/fontawesome-pro-6.4.0-web
.tools/gulp.config.js
file and add the following code in gulp config under build > plugins > global > src > optional
:"fontawesome-pro-6.4.0-web": {
styles: [
"{$config.path.common_src}/plugins/fontawesome-pro-6.4.0-web/css/all.css",
],
fonts: [
"{$config.path.common_src}/plugins/fontawesome-pro-6.4.0-web/webfonts/**",
],
},
tools/webpack/plugins/plugins.scss
.@import "~@fortawesome/fontawesome-free/css/all.min.css";
tools/webpack/plugins/plugins.scss
:@import "~@/src/plugins/fontawesome-pro-6.4.0-web/css/all.css";
<i class="fas fa-envelope-open-text"></i>
<i class="fab fa-affiliatetheme"></i>
<i class="fas fa-mail-bulk"></i>
<i class="fas fa-coins"></i>
<i class="fas fa-chart-pie"></i>
<i class="fas fa-percentage"></i>
<i class="fas fa-print"></i>
<i class="fas fa-pen-nib"></i>
thanks for sharing
Hi Carlos,
Thank you for sharing your solution! It's great to hear that you were able to resolve the issue with FontAwesome icons in Laravel Starter Kit 8.2.0 by updating the Webpack configuration.
Your revised configuration:
{
// fontawesome
search: /url\(.*?((fa-.*?)\..*?)"?\)/g,
replace: "url(./fonts/$2/$1)",
}
fixed it by this:
{
// fontawesome
search: /url\(.*?((fa-.*?)\..*?)'?\)/g,
replace: 'url(./fonts/$2/$1)',
},
thanks
I'm using Laravel starter kit 8.2.0, Do we need to change this on webpack?
{
// fontawesome
search: /url\((\.\.\/)?webfonts\/(fa-.*?)"?\)/g,
replace: 'url(./fonts/@fortawesome/$2)',
},
when I build with yarn run prod I get this on console when trying to use icons duotone from fontawesome:
GET https://m820.test/assets/plugins/global/fonts/@fortawesome/fa-duotone-900.woff2 net::ERR_ABORTED 404 (Not Found)
plugins.bundle.css:1 GET https://m820.test/assets/plugins/global/fonts/@fortawesome/fa-duotone-900.ttf 404 (Not Found)