# gulp-fa-minify

> remove unnecessary fa icons from font awesome 5 js files

Latest version **6.0.1** (published 2022-02-13) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install gulp-fa-minify
pnpm add gulp-fa-minify
yarn add gulp-fa-minify
bun add gulp-fa-minify
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.0.1 |
| Published | 2022-02-13 |
| First published | 2018-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | NetWin |
| Maintainers | netwin |
| Keywords | Gulp, FontAwesome, Minify |

## Links

- npm: https://www.npmjs.com/package/gulp-fa-minify
- Repository: https://github.com/FA-Minify/gulp-fa-minify
- Homepage: https://github.com/FA-Minify/gulp-fa-minify#readme
- Issues: https://github.com/FA-Minify/gulp-fa-minify/issues
- npm.io page: https://npm.io/package/gulp-fa-minify

## Dependencies (3)

- [through2](https://npm.io/package/through2.md) ^4.0.2
- [fa-minify](https://npm.io/package/fa-minify.md) ^6.0.1
- [plugin-error](https://npm.io/package/plugin-error.md) ^1.0.1

## Alternatives

- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) — 2.2M weekly downloads
- [roboto-fontface](https://npm.io/package/roboto-fontface.md) — 196.0K weekly downloads
- [@react-native-vector-icons/common](https://npm.io/package/@react-native-vector-icons/common.md) — 150.4K weekly downloads
- [@procore/core-icons](https://npm.io/package/@procore/core-icons.md) — 4.6K weekly downloads
- [@react-md/material-icons](https://npm.io/package/@react-md/material-icons.md) — 1.6K weekly downloads

## Recent versions

- 6.0.1 (latest) — 2022-02-13
- 1.2.2 — 2019-05-22
- 1.2.1 — 2019-04-16
- 1.2.0 — 2019-04-16
- 1.1.0 — 2018-07-25
- 1.0.1 — 2018-07-23
- 1.0.0 — 2018-07-23

## README

### FA-Minify

#### Install
```bat
npm i gulp-fa-minify
```

#### Description
A utility Gulp plugin to remove unused Icons from [FontAwesome 5/6](https://fontawesome.com/) when using [SVG with JavaScript](https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself#using-svgs).

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:
```javascript
  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](https://github.com/NetWin/fa-minify/blob/master/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](https://www.npmjs.com/package/gulp-uglify) for example is a simple one-liner.

---
_Source: https://npm.io/package/gulp-fa-minify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
