JSPM

purge-fa

0.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q20957F
  • License MIT

Purge all unused FontAwesome icons to reduce files.

Package Exports

  • purge-fa

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (purge-fa) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Purge-FA

Downloads Realease License

Remove your unused FontAwesome JS icons.

npm install purge-fa

Command line only for now:

./bin/purge-fa -c <content> -s <sources> -o <output> [options]

Required parameters

  • -c <content>: folder that contains your files to search icons in
  • -s <sources>: folder where your FA JS icons files not minified are (files named fa-(solid|light|regular|brands).js)
  • -o <output>: 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

  • 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 👍🏻