abkrim
1 year ago
101
6
General

Font Awesome 5 using Laravel-Mix on Laravel 5.5

Posted 1 year ago by abkrim

For my projects use font awesome 4, using,

npm install font-awesome

Add to app.scss

 @import "~font-awesome/scss/font-awesome.scss";

Add on muy templates

<span class="icon has-text-danger">
                            <i class="fa fa-ban"></i>
                            </span>

This work fine with Awesome 4 on unique 'css'

For Awesome 5 try..

npm i --save @fortawesome/fontawesome

On app.js after window.Vue = require('vue');

import fontawesome from '@fortawesome/fontawesome';

On template

<span class="icon has-text-danger">
                            <i class="fas fa-ban"></i>
                            </span>

On my own app.js i see

"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__fortawesome_fontawesome__ = __webpack_require__(37);

Result wrong..

https://pasteboard.co/H5CreoV.jpg

Some ideas?

Please sign in or create an account to participate in this conversation.