description | Yet Another Minifier. Minify and compress html, js, css and svg. |
homepage URL | https://github.com/curbengh/hexo-yam |
repository URL | https://github.com/curbengh/hexo-yam.git |
owner | curben@users.noreply.repo.or.cz |
last change | Sat, 8 Jun 2024 08:11:38 +0000 (8 08:11 +0000) |
last refresh | Sat, 8 Jun 2024 12:21:36 +0000 (8 14:21 +0200) |
mirror URL | git://repo.or.cz/hexo-yam.git |
https://repo.or.cz/hexo-yam.git | |
ssh://git@repo.or.cz/hexo-yam.git | |
bundle info | hexo-yam.git downloadable bundles |
content tags |
Yet Another Minifier for Hexo. Minify and compress HTML, JS, CSS, SVG, XML and JSON. Other files are also compressed. Support gzip, brotli and zstd compressions.
$ npm install hexo-yam --save --include=optional --force
minify:
enable: true
previewServer: true
html:
css:
js:
svg:
gzip:
brotli:
xml:
json:
true
.hexo server
. Defaults to true
.minify:
html:
enable: true
exclude:
true
.10
. Set lower value to set higher priority and vice versa.false
.For more options, see HTMLMinifier.
minify:
css:
enable: true
exclude:
- "*.min.css"
true
.10
.false
.2
.For more options, see clean-css.
minify:
js:
enable: true
exclude:
- "*.min.js"
true
.10
.false
.true
. Pass an object to specify mangle options.output: {comments: true}
.For more options, see Terser.
minify:
svg:
enable: true
include:
- "*.svg"
- "!*.min.svg"
true
.10
.false
.*.min.svg
by default.plugins:
# Retain comments
removeComments: false
# Do not remove unused ID attributes
cleanupIds: false
Remove whitespaces in xml.
minify:
xml:
enable: false
include:
- "*.xml"
- "!*.min.xml"
false
.10
.false
.*.min.xml
by default.true
.For more options, see minify-xml.
Remove whitespaces in json.
minify:
json:
enable: false
include:
- "*.json"
- "!*.min.json"
false
.10
.false
.*.min.json
by default.minify:
gzip:
enable: true
include:
- "*.html"
- "*.css"
- "*.js"
- "*.txt"
- "*.ttf"
- "*.atom"
- "*.stl"
- "*.xml"
- "*.svg"
- "*.eot"
- "*.json"
true
.10
.false
.include: ['*.html','*.css','*.js']
..html
is invalid. '*.html'
is valid.1-9
. Defaults to 9
, or the value of zlib.constants.Z_BEST_COMPRESSION
minify:
brotli:
enable: true
include:
- "*.html"
- "*.css"
- "*.js"
- "*.txt"
- "*.ttf"
- "*.atom"
- "*.stl"
- "*.xml"
- "*.svg"
- "*.eot"
- "*.json"
true
.10
.false
.1-11
. Defaults to 11
, or the value of zlib.constants.BROTLI_MAX_QUALITY
minify:
zstd:
enable: false
include:
- "*.html"
- "*.css"
- "*.js"
- "*.txt"
- "*.ttf"
- "*.atom"
- "*.stl"
- "*.xml"
- "*.svg"
- "*.eot"
- "*.json"
false
.10
.false
.1-22
. Defaults to 3
, or the value of DEFAULT_LEVEL
npm install --include=optional --force
Use "globOptions" to customise how glob patterns match files. Refer to micromatch for available options.
exclude:
- "*foo.html" # basename is enabled
- "**/bar/*/*.html" # basename is automatically disabled
- "*baz.css" # basename is enabled
globOptions:
basename: true # default
!
(negation).include:
option used in svg, gzip and brotli.include:
- "!foo.svg"
- "!**/bar/*/*.svg"
globOptions:
basename: true
All credits go to the following work:
18 months ago | v8.0.0 | commitlog | ||
2 years ago | v7.0.0 | commitlog | ||
2 years ago | v6.0.0 | commitlog | ||
3 years ago | v5.0.0 | commitlog | ||
3 years ago | v4.2.0 | commitlog | ||
4 years ago | v4.1.0 | commitlog | ||
4 years ago | v4.0.0 | commitlog | ||
4 years ago | v3.2.3 | commitlog | ||
4 years ago | v3.2.2 | commitlog | ||
4 years ago | v3.2.1 | commitlog | ||
4 years ago | v3.2.0 | commitlog | ||
4 years ago | v3.1.0 | commitlog | ||
4 years ago | v3.0.0 | commitlog | ||
4 years ago | v2.2.1 | commitlog | ||
4 years ago | v2.2.0 | commitlog | ||
4 years ago | v2.1.1 | commitlog | ||
... |
5 hours ago | master | logtree |
28 hours ago | zstd | logtree |
3 days ago | previewServer | logtree |
18 months ago | 8.0 | logtree |
19 months ago | swc | logtree |
5 years ago | upstream | logtree |