https://github.com/haplifeman/purge-fa
Purge all unused FontAwesome icons to reduce files.
https://github.com/haplifeman/purge-fa
font-awesome icons js minify optimization purge purify unused
Last synced: 24 days ago
JSON representation
Purge all unused FontAwesome icons to reduce files.
- Host: GitHub
- URL: https://github.com/haplifeman/purge-fa
- Owner: HapLifeMan
- License: mit
- Created: 2017-11-28T13:32:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-01T12:27:26.000Z (over 7 years ago)
- Last Synced: 2025-05-03T17:44:12.429Z (26 days ago)
- Topics: font-awesome, icons, js, minify, optimization, purge, purify, unused
- Language: JavaScript
- Size: 474 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Purge-FA
[](https://www.npmjs.com/package/purge-fa)
[](https://github.com/HapLifeMan/purge-fa/releases)
[](https://github.com/HapLifeMan/purge-fa/blob/master/LICENSE)Remove your unused FontAwesome JS icons.
```
npm install purge-fa
```Command line only for now:
```
./bin/purge-fa -c -s -o [options]
```## Required parameters
- `-c `: folder that contains your files to search icons in
- `-s `: folder where your FA JS icons files **not minified** are (files named `fa-(solid|light|regular|brands).js`)
- `-o `: output folder of purged icon files## Optional parameters
### `-w` to whitelist icons
If you want to whitelist icons for some reason, you can add them as many as you want as follow:
```
-w.fa=lock // Will add the solid lock icon to whitelist
-w.fal=user // Will add the light user icon to whitelist
-w.far=cogs // Will add the regular cogs icon to whitelist
-w.fab=github // Will add the brand GitHub icon to whitelist
```## To do
- [x] Add a whitelist option
- [ ] Create a webpack plugin
- [ ] Find FA JS source files automatically
- [ ] Option to bundle files
- [ ] Option to minify file(s)
- [ ] Option to include `fontawesome.min.js` in bundle
- [ ] Make command line prettier (help, flags...)Feel free to send pull requests 👍🏻