node package manager

hexo-filter-cleanup

Hexo-filter-cleanup

npm version NPM Dependencies

This project is inspired by hexo-all-minifier.

I completely re-wrote this hexo filter plugin because hexo-all-minifier has certain issues as below which sucks my hexo project on mac osx platform. Besides that i have added some other cool features like useref and performance improvements.

All in one. Minifier & Optimization plugin for Hexo.

Installation

$ npm install hexo-filter-cleanup --save

Features

Integrate all the official minifier plugins of HEXO and some other optimization plugins:

Thanks for their works.

Options

hfc_useref:
  enable: true
  concat: true
  exclude: 
  • enable - Enable the plugin. Defaults to true.
  • exclude: Exclude files
  • concat: concat the referenced files automatically.

hfc_html:
  enable: true
  exclude: 
  • enable - Enable the plugin. Defaults to true.
  • exclude: Exclude files

hfc_css:
  enable: true
  exclude: 
    - '*.min.css'
  • enable - Enable the plugin. Defaults to true.
  • exclude: Exclude files

hfc_js:
  enable: true
  mangle: true
  output:
  compress:
  exclude: 
    - '*.min.js'
  • enable - Enable the plugin. Defaults to true.
  • mangle: Mangle file names
  • output: Output options
  • compress: Compress options
  • exclude: Exclude files

hfc_img:
  enable: true
  interlaced: false
  multipass: false
  optimizationLevel: 2
  pngquant: false
  progressive: false
  webp: true
  webpQuality: 75
  gifslice: true
  jpegtran: true
  jpegrecompress: false
  jpegrecompressQuality: 'medium'
  optipng: true
  svgo: true
  • enable - Enable the plugin. Defaults to true.
  • interlaced - Interlace gif for progressive rendering. Defaults to false.
  • multipass - Optimize svg multiple times until it’s fully optimized. Defaults to false.
  • optimizationLevel - Select an optimization level between 0 and 7. Defaults to 2.
  • pngquant - Enable imagemin-pngquant plugin. Defaults to false.
  • progressive - Lossless conversion to progressive. Defaults to false.
hfc_favicons:
  enable: true
  src: img/logo.png
  target: img/
  icons:
    android: true
    appleIcon: true
    appleStartup: false
    coast: false
    favicons: true
    firefox: false
    opengraph: false
    windows: true
    yandex: false

Debug Mode

The debug mode will disable all the optimizations.

You can active the debug mode by using hexo's --debug switch as below.

hexo s --watch --debug

Todo: Tests