Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add font-awesome to gulp project correctly

How can I add and use font awesome in my new gulp-scss-bootstrap project? What is the clean and right way to do it? Thanks.

like image 459
Anna Avatar asked Dec 03 '22 20:12

Anna


1 Answers

1 download fontawesome 5

npm install --save-dev @fortawesome/fontawesome-free

2 in a SCSS file

@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 in gulpfile.js add a task

gulp.task('icons', function() {
    return gulp.src('node_modules/@fortawesome/fontawesome-free/webfonts/*')
        .pipe(gulp.dest(dist+'/assets/webfonts/'));
});
like image 73
Yifan Avatar answered Dec 12 '22 05:12

Yifan