真棒字体无法安装-Laravel 6&Mix

时间:2020-02-25 08:17:00

标签: php laravel webpack sass font-awesome

我将要把我的​​应用程序推向生产阶段,但目前还不行(以下所有屏幕截图均来自本地计算机),但是当尝试安装fontawesome时,我遇到了问题。 / p>

我已经尝试了所有可以在stackoverflow和此处找到的内容,但是我只看到方形图标。似乎并没有拉动图标。

Image of App

Image of App

Image of App

APP.SCSS:

// Fonts
@import url('https://fonts.googleapis.com/css?family=Nunito');

@import '~@fortawesome/fontawesome-free/scss/fontawesome.scss';
@import '~@fortawesome/fontawesome-free/scss/solid.scss';
@import '~@fortawesome/fontawesome-free/scss/regular.scss';
@import '~@fortawesome/fontawesome-free/scss/brands.scss';

// Variables
@import 'variables';

// Custom
@import 'custom';

// Bootstrap
@import '~bootstrap/scss/bootstrap';

// Select 2 dropdown
@import '~select2/dist/css/select2.css';

// ChartJS
//@import '~chart.js/dist/Chart.min.css';

//Datatables
@import '~datatables.net-bs4/css/dataTables.bootstrap4.css';

我还尝试将字体复制到webfonts文件夹中,因此为什么在以下结构中有重复项:

Image of App

仍然没有运气。我还尝试将以下内容添加到我的app.scss文件中:

$fa-font-path: "./webfonts";

此外,我在编译的app.css中发现了这一点

Image of App

对象模块?

我在这里想念什么?我尝试创建一个新项目,并且字体效果很棒。我已经检查了webpack.mix及其所有标准。无需使用额外的配置:

const mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');

/*mix.copy('node_modules/@fortawesome/fontawesome-free/', 'public/webfonts')*/

mix.copy(
    'resources/js/custom/*.js',
    'public/js/custom/');

编辑-这是我的node_modules:

Image of App

0 个答案:

没有答案