Commit Graph

40 Commits

Author SHA1 Message Date
Ming Di Leom 7639547408
Merge pull request #157 from curbengh/previewServer
feat: previewServer option
2024-06-07 20:06:54 +09:30
MDLeom 7f2033e553
feat: zstd compression
disabled by default due to lack of server support
close #156
2024-06-06 11:14:57 +00:00
MDLeom e9584b2e0b
feat: previewServer option
BREAKING CHANGE
plugin is now disabled by default when running `hexo server`,
unless previewServer is set to false.

Close #154
Inspired by e778c55f37/index.js (L49)
2024-06-05 11:08:12 +00:00
MDLeom c0041b0f23
fix(svg): compatibility with svgo 2.4+
- overriding default plugins
- https://github.com/svg/svgo/releases/tag/v2.4.0
2021-10-10 09:19:50 +00:00
MDLeom 3819909c84
chore(deps): bump svgo from 1.3.2 to 2.3.0 (BREAKING CHANGE)
- BREAKING CHANGE: syntax of minify.svg.plugins option
  * https://github.com/svg/svgo/releases/tag/v2.0.0
- svgo optimize() changed from async to sync
2021-04-25 08:25:32 +00:00
MDLeom c57e227efd
fix: set default config 2020-09-05 11:41:22 +00:00
MDLeom ce8c4a145b
refactor(test): set default config in individual test 2020-09-05 11:18:35 +00:00
curbengh fdcdbef4a1
feat: minify json 2020-01-03 01:17:37 +00:00
curbengh 317b5e43d3
feat: minify xml 2020-01-03 00:35:25 +00:00
curbengh 440b9ccd8c
feat: rename 'logger:' option to 'verbose:'
BREAKING CHANGE
2019-12-27 22:54:09 +00:00
curbengh 679dcaf077
test: add tests for html, js, css minifiers 2019-12-26 13:19:39 +00:00
curbengh 887eeda3cc
feat: add 'priority' options 2019-10-09 23:33:34 +01:00
curbengh 90bfe2ca36
style: to rename 'logger' to 'verbose' 2019-09-24 23:56:44 +01:00
curbengh 7085b15d10
style: rename logic* to minify* or *Fn 2019-09-15 16:55:36 +01:00
curbengh 7e85bd6338
feat: enable plugin by default and update options naming 2019-09-11 02:15:19 +01:00
curbengh 43a316d149
refactor: use basename instead of matchBase 2019-08-06 11:23:58 +09:30
weyusi c69b6d3356 feat: switch nanomatch to micromatch 2019-07-10 11:50:23 +09:30
weyusi 0ce066c2fd fix(html-minifier): ignore post excerpt tag
https://hexo.io/docs/tag-plugins#Post-Excerpt
2019-06-08 17:22:40 +09:30
weyusi 655f65adcd refactor: add 'use strict' 2019-05-27 10:44:04 +09:30
weyusi db58c8e686 fix: typo in default config of svgo 2019-05-21 13:45:18 +09:30
weyusi f05c379687 feat: assign more default options for html-minifier
* to minify more stuff.
  * remove deprecated removeCommentsFromCDATA
  * add removeScriptTypeAttributes and removeStyleLinkTypeAttributes
    * noticed from https://github.com/weyusi/hexo-nofollow/issues/4#issue-445559505
  * ref https://github.com/kangax/html-minifier
2019-05-18 17:01:15 +09:30
weyusi c9b7323768 refactor: remove default ignoreCustomComments from html-minifier
not sure why upstream has it in the first place ¯\_(ツ)_/¯
2019-05-18 14:19:42 +09:30
weyusi cdee4c0768 style: Standard JS 2019-05-02 15:55:43 +09:30
weyusi 374c16575b style: rearrange and give more neat_js config examples 2019-04-23 17:46:56 +09:30
weyusi 15465ca16b feat: minify svg using svgo 2019-04-23 17:33:30 +09:30
weyusi 528486761d feat: allow custom file extension for compressions 2019-04-23 15:10:43 +09:30
weyusi ce973f940f docs: rearrange options 2019-04-23 13:32:08 +09:30
weyusi 94a8f90c2b feat: allow custom options for neat_css
https://github.com/jakubpawlowicz/clean-css
2019-04-23 13:26:43 +09:30
weyusi 0946ab2f7b refactor: remove object-assign ponyfill
Object.assign() is supported by node 4 and up
2018-10-27 18:38:12 +10:30
weyusi 9c97c00aa4 refactor: var to let/const
https://hacks.mozilla.org/2015/07/es6-in-depth-let-and-const/
2018-10-26 15:27:23 +10:30
weyusi d2d92bc539 Disable logging by default 2018-10-25 20:15:26 +10:30
weyusi 58adaeb34d Use js standard style
https://standardjs.com/
2018-10-25 20:05:59 +10:30
weyusi 1dafc72850 Use after_generate instead of before_exit
before_exit was a workaround instead of proper after_generate
Use hexo router instead of filesystem manipulation, so hexo-fs is not required anymore
this approach also allows size comparison of original and compressed file, just like minifier currently have
inspired by
 - https://www.travisgeis.com/2018/04/23/lazy-image-resizing-in-hexo-image-sizes-v2/
 - https://github.com/ottobonn/hexo-image-sizes/blob/master/lib/ImageResizer.js
 - https://github.com/chenzhutian/hexo-all-minifier/blob/master/lib/concatJS.js
 - https://stackoverflow.com/a/39441194
2018-10-05 13:38:55 +09:30
weyusi b6425e622e Add brotli compression 2018-09-30 17:00:32 +09:30
weyusi 2dc6c5f48e Don't run gzip when public folder has/does not exist
Continuation of 71c5878400
This is necessary especially to prevent gzip from running when hexo clean
2018-09-29 15:11:14 +09:30
weyusi 71c5878400 Use 'after_generate' instead of 'before_exit'
Compatibility with hexo clean
2018-09-28 17:22:22 +09:30
weyusi ea13ea9967 Add gzip compression 2018-09-28 17:13:54 +09:30
weyusi 4745870028 uglify3 compatibility
Credit to 8d9f2da8276652ef270e943dbf9dcb648e14ed55
2018-09-27 18:13:19 +09:30
mygu 8300b72478 Add a print log configuration switch to solve compilation performance problems 2018-06-29 16:08:47 +08:00
rozbo b3be6d5b97 init code 2016-05-26 19:09:41 +08:00