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 | Sun, 28 Jan 2024 10:44:53 +0000 (28 21:14 +1030) |
last refresh | Sat, 27 Apr 2024 09:17:33 +0000 (27 11:17 +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 and brotli compressions.
$ npm install hexo-yam --save
minify:
enable: true
html:
css:
js:
svg:
gzip:
brotli:
xml:
json:
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
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
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.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
While most modern web browsers support Brotli, you also need to consider whether the web/app server, hosting platform, reverse proxy or CDN (whichever relevant to you) support it.
Brotli support as of May 2022:
Name | Brotli support |
---|---|
GitHub Pages | In consideration |
GitLab Pages | Yes |
Netlify | Yes |
Hexo Server | In progress |
If you have access to the web server config, you should disable on-the-fly compression for static files (that are already compressed by this plugin),
.gz
.br
files and on-the-fly gzip compress dynamic files. v2.4.0+ requires specifying the precompressed
option..br
files will be served while dynamic content can be compressed on-the-fly. Protip: brotli_types text/plain text/css application/javascript application/json image/svg+xml application/xml+rss;
to prevent compressing media files (which are already compressed anyway).All credits go to the following work:
17 months ago | v8.0.0 | commitlog | ||
23 months ago | v7.0.0 | commitlog | ||
2 years ago | v6.0.0 | commitlog | ||
2 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 | ||
... |
2 months ago | dependabot/github_actions/codecov/codecov-action-4 | logtree |
2 months ago | master | logtree |
17 months ago | 8.0 | logtree |
17 months ago | swc | logtree |
5 years ago | upstream | logtree |