Nifty Pony Merchandise

    gulp-fa-minify
    TypeScript icon, indicating that this package has built-in type declarations

    6.0.1 • Public • Published

    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.

    Install

    npm i gulp-fa-minify

    DownloadsWeekly Downloads

    88

    Version

    6.0.1

    License

    MIT

    Unpacked Size

    6.72 kB

    Total Files

    5

    Last publish

    Collaborators

    • netwin