如何在新的gulp-scss-bootstrap项目中添加和使用超棒的字体?什么是清洁正确的方法?谢谢。
1下载fontawesome 5
npm install --save-dev @fortawesome/fontawesome-free
2在SCSS文件中
@import "../../../node_modules/@fortawesome/fontawesome-free/scss/fontawesome"; @import "../../../node_modules/@fortawesome/fontawesome-free/scss/brands"; @import "../../../node_modules/@fortawesome/fontawesome-free/scss/regular"; @import "../../../node_modules/@fortawesome/fontawesome-free/scss/solid"; @import "../../../node_modules/@fortawesome/fontawesome-free/scss/v4-shims";
3在gulpfile.js中添加任务
gulp.task('icons', function() { return gulp.src('node_modules/@fortawesome/fontawesome-free/webfonts/*') .pipe(gulp.dest(dist+'/assets/webfonts/')); });