Commit Graph

61 Commits

Author SHA1 Message Date
curbengh 631503aa1a
fix: Terser should throw error if there is invalid option
- Other functions also throw error to abort
2019-12-26 15:06:32 +00:00
curbengh b046d2a09e
fix: disable basename by invidual pattern 2019-12-26 14:44:42 +00:00
curbengh 7eda55a1aa perf: use + operator
instead of Array.push()
https://stackoverflow.com/a/55409094
2019-12-16 08:43:35 +00:00
curbengh 1fdac53793 style: object-shorthand
https://eslint.org/docs/rules/object-shorthand
2019-12-16 08:43:35 +00:00
curbengh 2548eb20bf
fix(js): remove 'priority' option
- Terser really doesn't like unsupported options
- 'priority' is introduced in 887eeda3cc
2019-11-09 07:18:59 +00:00
curbengh de425e4b6f
refactor: destructure object 2019-11-09 07:16:07 +00:00
curbengh 213700a617
fix: array should join() without a separator
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join
2019-10-10 08:04:56 +01:00
curbengh 48bf9951f0
fix: join Array, instead of using first index 2019-10-06 09:24:25 +01:00
curbengh 461fe1dd41
fix: bind 'this' to error() 2019-10-06 06:33:35 +01:00
curbengh 5de4a237b7
refactor: convert Stream to Buffer using Array.push() 2019-10-06 06:32:35 +01:00
curbengh 2c5ad19932
fix: utilize hexo.log to display error message 2019-10-04 08:27:25 +01:00
curbengh e473408673
feat: support native brotli 2019-09-25 01:33:47 +01:00
curbengh 60a045e429
refactor: async/await
- https://dev.to/gafi/7-reasons-to-always-use-async-await-over-plain-promises-tutorial-4ej9
- https://stackoverflow.com/a/56975197
2019-09-25 01:14:37 +01:00
curbengh fd474580ce
refactor: destructure object 2019-09-24 23:55:07 +01:00
curbengh 7085b15d10
style: rename logic* to minify* or *Fn 2019-09-15 16:55:36 +01:00
curbengh b5639aba85
refactor: logger function 2019-09-15 16:51:15 +01:00
curbengh 36bca1b939
refactor: use const function 2019-09-15 16:16:53 +01:00
curbengh 7e85bd6338
feat: enable plugin by default and update options naming 2019-09-11 02:15:19 +01:00
curbengh ede71a0857
fix: options.exclude might not exist
Fixes a6f59a9704 (r34629621)
2019-08-09 11:48:08 +09:30
curbengh 32a519928a
style: standard 2019-08-06 11:57:44 +09:30
curbengh a6f59a9704
feat: disable basename globbing when pattern contains slash 2019-08-06 11:26:11 +09:30
weyusi c69b6d3356 feat: switch nanomatch to micromatch 2019-07-10 11:50:23 +09:30
weyusi 655f65adcd refactor: add 'use strict' 2019-05-27 10:44:04 +09:30
weyusi 8531b77cfc style: arrow function
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions
2019-05-21 11:16:14 +09:30
weyusi a87dd05ff4 refactor: new is not necessary
https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_string_encoding
2019-05-02 16:34:11 +09:30
weyusi cdee4c0768 style: Standard JS 2019-05-02 15:55:43 +09:30
weyusi cceae36368 style: fix comment 2019-04-23 17:57:52 +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 ad5f82712c style: tab to space 2019-04-23 13:35:59 +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 5a5a6fb504 fix: neat_js exclude
delete operator previously remove reference including 'options.exclude',
use Object.assign to clone 'options' object to prevent that.
https://stackoverflow.com/a/33053362
2019-04-23 12:30:47 +09:30
weyusi 1de8ec2cd9 refactor: use nanomatch.some()
.some supports string and array patterns, so no need for loop.
https://github.com/micromatch/nanomatch#some
2019-04-23 12:25:17 +09:30
weyusi 5e19490e44 refactor: switch minimatch to nanomatch
https://github.com/micromatch/nanomatch
2019-04-22 21:40:15 +09:30
weyusi f1171393f8 refactor: drop bluebird 2019-04-22 20:27:42 +09:30
weyusi 369bad96b7 refactor: use new method of accessing zlib constants
"Accessing the constants directly from the module is currently still possible but is deprecated."
https://nodejs.org/api/zlib.html#zlib_zlib_constants
2019-04-22 20:08:50 +09:30
weyusi 4f5104c408 fix: use the default options for brotli
brotli already defaults to max (11) compression level
BROTLI_MAX_QUALITY is unnecessary and somehow corresponds to lower level
2019-04-22 18:28:00 +09:30
weyusi 49c9fcb310 feat: support more file extensions
based on the list by https://github.com/philnash/jekyll-gzip
2019-04-22 18:24:31 +09:30
weyusi 2a9c5a52b4 feat: switch to terser for ES6 compatibility 2019-04-10 19:24:02 +09:30
weyusi 3bd69a5b24 feat: compress xml and json 2019-03-08 21:07:51 +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 a6c5727d4b Remove unused library 2018-10-25 20:14:27 +10:30
weyusi 58adaeb34d Use js standard style
https://standardjs.com/
2018-10-25 20:05:59 +10:30
weyusi 8a8c5563c4 Apply level 2 optimisation of clean-css
https://github.com/jakubpawlowicz/clean-css#level-2-optimizations
2018-10-19 12:34:34 +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 d99b1d3158 Brotli max compression level is 11
c6333e1e79/c/include/brotli/encode.h (L42)
2018-10-02 09:53:08 +09:30
weyusi 03668833cf Set maximum brotli compression level 2018-10-01 17:50:47 +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