6.0.1 • Published 2 years ago

gulp-fa-minify v6.0.1

Weekly downloads
26
License
MIT
Repository
github
Last release
2 years ago

FA-Minify

Install

npm i gulp-fa-minify

Description

A utility Gulp plugin to remove unused Icons from FontAwesome 5/6 when using SVG with JavaScript.

The JavaScript files included in FontAwesome 5/6 can lead to a bundle size increase of ~900kb (or even >2.5MB if you have Access to the Pro Version). Only including the needed Icons can lead to a massive size reduction and performance increase.

Use it as a normal gulp plugin in your workflow:

  const usedIcons = {
    fal: [],
    far: ['copy'],
    fas: ['copy', 'gears', 'address-book'],
    fab: []
  };

  return gulp.src('./path/to/font-awesome/all.js')
    .pipe(faMinify(usedIcons))
    .pipe(gulp.dest('./'));

(Full Example: gulpfile.js )

Attention: Only works with the non minified JavaScript files because this plugin uses regular expressions to find the defined icons. But adding the gulp-uglify for example is a simple one-liner.

6.0.1

2 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago