Skip to content

Instantly share code, notes, and snippets.

@baslie
Last active December 5, 2020 22:37
Show Gist options
  • Save baslie/44b2514c7cf13873b43d50f1fd60d7fd to your computer and use it in GitHub Desktop.
Save baslie/44b2514c7cf13873b43d50f1fd60d7fd to your computer and use it in GitHub Desktop.
PurifyCSS: CLI Usage
purifycss src/css/main.css src/css/bootstrap.css src/js/main.js --min --info --out src/dist/index.css
====================================================================================================
In example above the command will concat both main.css and bootstrap.css and purify it by looking at what CSS selectors were used inside of main.js. It will then write the result to dist/index.css
usage: purifycss <css> <content> [option ...]
options:
--min Minify CSS
--out [filepath] Filepath to write purified CSS to
--info Logs info on how much CSS was removed
--rejected Logs the CSS rules that were removed
-h, --help Prints help (this message) and exits
The --min flag minifies the result.
The --info flag will print this to stdout:
##################################
PurifyCSS has reduced the file size by ~35.2%
##################################
The CLI currently does not support file patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment