Need help with hexo-all-minifier?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

chenzhutian
226 Stars 32 Forks MIT License 175 Commits 15 Opened issues

Description

A plugin for Hexo that optimizes HTML, CSS, JS and imagages, and it can optionally deploys your blog.

Services available

!
?

Need anything else?

Contributors list

# 198,226
CSS
imagemi...
html-mi...
Shell
110 commits
# 184
nextjs
postman...
graphql...
angular...
20 commits
# 259,484
Amazon ...
CSS
HTML
html-mi...
4 commits
# 512,617
CSS
HTML
imagemi...
html-mi...
2 commits
# 37,131
C
JavaFX
Svelte
html-mi...
1 commit
# 9,198
Rust
Go
gdrive
google-...
1 commit
# 164,992
html-mi...
Node.js
libuv
Dart
1 commit
# 667,537
CSS
HTML
imagemi...
html-mi...
1 commit
# 17,115
TypeScr...
CSS
Vue.js
Nuxt.js
1 commit
# 292,666
CSS
HTML
imagemi...
html-mi...
1 commit
# 1,703
Java
Android
filedow...
Kotlin
1 commit
# 89,737
vue2
GraphQL
vuejs2
CSS
1 commit

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

bash
$ brew install libtool automake autoconf nasm

Usage

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

yaml
all_minifier: true
If you need futher control of this plugin, please refer the options below.

Options

:star2::new:!NEW

yaml
js_concator:
  enable: false
  bundle_path: '/js/bundle.js'
  front: false
  silent: false
- enable - Enable the Js concator. Defaults to
false
. - bundle_path - The output path of the bundle script. It will be set as absolute path to the root dir. - front - Put the bundle script in the front of all scripts in
body
tag. Default to
false
, which means the bundle script will be placed in the back of other scripts. - silent - Disable logging optimize informations. Defaults to
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:
  • enable - Enable the HTML minifier. Defaults to
    true
    .
  • ignore_error - Ignore the error occurred on parsing html.
  • silent - Disable logging optimize informations. Defaults to
    false
    .
  • exclude - Exclude files. Glob is support.

css_minifier:
  enable: true
  silent: false
  exclude: 
    - '*.min.css'
  • enable - Enable the CSS minifier. Defaults to
    true
    .
  • silent - Disable logging optimize informations. Defaults to
    false
    .
  • exclude - Exclude files. Glob is support.

js_minifier:
  enable: true
  mangle: true
  silent: false
  output:
  compress:
  exclude: 
    - '*.min.js'
  • enable - Enable the JS minifier. Defaults to
    true
    .
  • mangle: Mangle file names
  • output: Output options. If it is empty, please remove it from the .yml file! Otherwise it will be set to
    null
    , which is different from
    undefined
    .
  • compress: Compress options. If it is empty, please remove it from the .yml file! Otherwise it will be set to
    null
    , which is different from
    undefined
    .
  • silent - Disable logging optimize informations. Defaults to
    false
    .
  • exclude: Exclude files. Glob is support.

image_minifier:
  enable: true
  interlaced: false
  multipass: false
  optimizationLevel: 2
  pngquant: false
  progressive: false
  silent: false
  • enable - Enable the image minifier. 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
    .
  • silent - Disable logging optimize informations. Defaults to
    false
    .
  • exclude - Exclude specific types of image files, the input value could be
    gif
    ,
    jpg
    ,
    png
    , or
    svg
    . Default to null. Glob is not support.

Components

Integrate all the official minifier plugins of HEXO and a imagemin plugin: - hexo-html-minifier, which is based on HTMLMinifier - hexo-clean-css, which is based on clean-css - hexo-uglify, which is based on UglifyJS - hexo-imagemin, which is based on imagemin

Thanks for their work.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.