hexo-lightning-minify
WIP
中文版本
Introduction
This plugin is a minifier module split from hexo-renderer-multi-next-markdown-it.
Based on more modern minifiers (such as lightningcss
and minify-html
), it significantly improves speed compared to the older version.
If you need more comprehensive optimization, you can try hexo-optimize. This project is more inclined to exist as a supporting package for ShokaX, thus it only provides basic minification and optimization functions.
Installation
pnpm add hexo-lightning-minify # Recommended to use pnpm
npm install hexo-lightning-minify
Configuration
minify:
js:
enable: true
exclude:
css:
enable: true
options:
targets: ">= 0.5%"
exclude:
html:
enable: true
options:
comments: false
exclude:
image:
enable: true
options:
avif: false
webp: true
quality: 80
effort: 2
replaceSrc: true
exclude:
Features
Comparison
On ShokaX v0.3.9:
When run hexo g
,hexo-lightning-minify
runs ~1.88x faster than HRMNMI(HRMMIR),~1.3x faster than hexo-neat
based on hexo-many-posts test:
| base | hexo-neat | hexo-minify | hexo-all-minifier | hexo-lightning-minify |
---|
landscape | 10.529s | 37.918s | 36.844s | 38.572s | 16.304s |
next | 27.275s | 36.124s | 42.854s | 37.063s | 29.880s |
butterfly | 13.853s | 26.641s | 26.736s | 35.973s | 16.796s |
particlex | 24.422s | 200.641s | 193.981s | 201.601s | 40.478s |
reimu | 17.631s | 52.432s | 48.524s | 51.835s | 23.938s |
shokax(hexo-renderer-marked) | 13.189s | 20.618s | 19.658s | 22.448s | 14.619s |