chenzhutian / hexo-all-minifier

A plugin for Hexo that optimizes HTML, CSS, JS and imagages, and it can optionally deploys your blog.
MIT License
283 stars 30 forks source link
css hexo html-minifier imagemin js-concatenation minifies optimizer-plugin

Hexo-all-minifier

Greenkeeper badge Build Status codecov npm version NPM Dependencies

:star2::new:Try the latest feature JS_Concator in v0.4.0

All in one. Minifier & Optimization plugin for Hexo.

Installation

$ npm install hexo-all-minifier --save

For Mac User, maybe you need to install something more

$ brew install libtool automake autoconf nasm

Usage

Just put this line in the config file of your hexo-site to enable this plugin.

all_minifier: true

If you need futher control of this plugin, please refer the options below.

Options

:star2::new:!NEW

js_concator:
  enable: false
  bundle_path: '/js/bundle.js'
  front: false
  silent: false

The concator will concat all local scripts into one bundle script and attach it to the end of html's body tag. More detail control will be allowed in the future version.

html_minifier:
  enable: true
  ignore_error: false
  silent: false
  exclude:

css_minifier:
  enable: true
  silent: false
  exclude: 
    - '*.min.css'

js_minifier:
  enable: true
  mangle: true
  silent: false
  output:
  compress:
  exclude: 
    - '*.min.js'

image_minifier:
  enable: true
  interlaced: false
  multipass: false
  optimizationLevel: 2
  pngquant: false
  progressive: false
  silent: false

Components

Integrate all the official minifier plugins of HEXO and a imagemin plugin:

Thanks for their work.