jekyll-assets
jekyll-assets copied to clipboard
Support removing unused css
Hi, thanks for this awesome tool.
This is a feature request. If by any chance, would you consider to support removing unused css in the pipeline? This can be beneficial as it dramatically reduces the size of the assets and helps to boost website loading speed.
There are some existing tools which you can integrate into jekyll-assets to support such feature:
- https://github.com/purifycss/purifycss
- https://github.com/giakki/uncss
- https://github.com/FullHuman/purgecss
All of them have a command line interface.
If I am not mistaking this article should have all of the relevant code:
https://cobwwweb.com/use-purge-css-to-optimize-jekyll
I'd be surprised if that code works reliably, since Jekyll-Asset's is fully asynchronous, so relying on Jekyll to determine when Jekyll-Assets has completed is gonna race sometime, especially if you rely on a large set of assets, or have slow bound IO.
https://github.com/envygeeks/jekyll-assets#hooks