Git Product home page Git Product logo

hexo-all-minifier's Introduction

Hexo-all-minifier

Greenkeeper badge Build Status codecov npm version NPM Dependencies

🌟🆕Try the latest feature JS_Concator in v0.4.0

All in one. Minifier & Optimization plugin for Hexo.

Installation

$ npm install hexo-all-minifier --save

For Mac User, maybe you need to install something more

$ brew install libtool automake autoconf nasm

Usage

Just put this line in the config file of your hexo-site to enable this plugin.

all_minifier: true

If you need futher control of this plugin, please refer the options below.

Options

🌟🆕!NEW

js_concator:
  enable: false
  bundle_path: '/js/bundle.js'
  front: false
  silent: false
  • enable - Enable the Js concator. Defaults to false.
  • bundle_path - The output path of the bundle script. It will be set as absolute path to the root dir.
  • front - Put the bundle script in the front of all scripts in body tag. Default to false, which means the bundle script will be placed in the back of other scripts.
  • silent - Disable logging optimize informations. Defaults to false.

The concator will concat all local scripts into one bundle script and attach it to the end of html's body tag. More detail control will be allowed in the future version.

html_minifier:
  enable: true
  ignore_error: false
  silent: false
  exclude:
  • enable - Enable the HTML minifier. Defaults to true.
  • ignore_error - Ignore the error occurred on parsing html.
  • silent - Disable logging optimize informations. Defaults to false.
  • exclude - Exclude files. Glob is support.

css_minifier:
  enable: true
  silent: false
  exclude: 
    - '*.min.css'
  • enable - Enable the CSS minifier. Defaults to true.
  • silent - Disable logging optimize informations. Defaults to false.
  • exclude - Exclude files. Glob is support.

js_minifier:
  enable: true
  mangle: true
  silent: false
  output:
  compress:
  exclude: 
    - '*.min.js'
  • enable - Enable the JS minifier. Defaults to true.
  • mangle: Mangle file names
  • output: Output options. If it is empty, please remove it from the .yml file! Otherwise it will be set to null, which is different from undefined.
  • compress: Compress options. If it is empty, please remove it from the .yml file! Otherwise it will be set to null, which is different from undefined.
  • silent - Disable logging optimize informations. Defaults to false.
  • exclude: Exclude files. Glob is support.

image_minifier:
  enable: true
  interlaced: false
  multipass: false
  optimizationLevel: 2
  pngquant: false
  progressive: false
  silent: false
  • enable - Enable the image minifier. Defaults to true.
  • interlaced - Interlace gif for progressive rendering. Defaults to false.
  • multipass - Optimize svg multiple times until it’s fully optimized. Defaults to false.
  • optimizationLevel - Select an optimization level between 0 and 7. Defaults to 2.
  • pngquant - Enable imagemin-pngquant plugin. Defaults to false.
  • progressive - Lossless conversion to progressive. Defaults to false.
  • silent - Disable logging optimize informations. Defaults to false.
  • exclude - Exclude specific types of image files, the input value could be gif,jpg, png, or svg. Default to null. Glob is not support.

Components

Integrate all the official minifier plugins of HEXO and a imagemin plugin:

Thanks for their work.

hexo-all-minifier's People

Contributors

alexjoverm avatar asing1001 avatar chenzhutian avatar greenkeeper[bot] avatar jacksgong avatar jimmyn avatar jonathancbatista avatar meritozh avatar njzjz avatar outloudvi avatar stephencroberts avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hexo-all-minifier's Issues

Cannot minify NexT local search script

Cannot minify NexT local search script.

But using the uglify-es in command line could minify it.

Here is the script: https://github.com/theme-next/hexo-theme-next/blob/master/layout/_third-party/search/localsearch.swig

And my package.json:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.4.4"
  },
  "dependencies": {
    "hexo": "^3.4.4",
    "hexo-all-minifier": "^0.5.1",
    "hexo-deployer-git": "^0.3.1",
    "hexo-filter-plantuml": "^1.0.2",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-atom-markdown-writer-meta": "^0.1.1",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-feed": "^1.2.0",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-searchdb": "^1.0.8",
    "hexo-generator-seo-friendly-sitemap": "0.0.21",
    "hexo-generator-tag": "^0.2.0",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-markdown-it-plus": "^1.0.2",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-server": "^0.3.1",
    "hexo-symbols-count-time": "^0.2.0",
    "markdown-it-criticmarkup": "0.0.1",
    "markdown-it-task-lists": "^2.1.0"
  }
}

And my minifiers config:

# Minifier
all_minifier: true

## HTML
html_minifier:
  enable: true
  ignore_error: false
  silent: false
  exclude:

## CSS
css_minifier:
  enable: true
  silent: false
  exclude:
    - '*.min.css'

## JS
js_minifier:
  enable: true
  mangle: true
  silent: false
  exclude:

# Image
image_minifier:
  enable: true
  interlaced: false
  multipass: false
  optimizationLevel: 2
  pngquant: false
  progressive: false
  silent: false

# JS Concator
js_concator:
  enable: true
  bundle_path: '/js/bundle.js'
  front: true
  silent: false

Run only when generating

Here is a working line of code to add to index.js to run the minifier only when generating the site, not when serving.

if (process.argv.indexOf('server') > -1 || process.argv.indexOf('s') > -1 || process.argv.indexOf('serve') > -1) 
{
  return;
}

cjpeg error?

FATAL {
err: Error: Command failed: /home/jhsy/hexo/node_modules/mozjpeg/vendor/cjpeg -baseline
Unrecognized input file format --- perhaps you need -targa
at makeError (/home/jhsy/hexo/node_modules/imagemin-mozjpeg/node_modules/execa/index.js:174:9)
at /home/jhsy/hexo/node_modules/imagemin-mozjpeg/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
code: 1,
stdout: ,
stderr: <Buffer 55 6e 72 65 63 6f 67 6e 69 7a 65 64 20 69 6e 70 75 74 20 66 69 6c 65 20 66 6f 72 6d 61 74 20 2d 2d 2d 20 70 65 72 68 61 70 73 20 79 6f 75 20 6e 65 65 ... 9 more bytes>,
failed: true,
signal: null,
cmd: '/home/jhsy/hexo/node_modules/mozjpeg/vendor/cjpeg -baseline',
timedOut: false,
killed: false
}
}

js_concator 有这个问题

js_concator 开启时会有这个问题,看上去像是script里面有undefined的值,不知道为什么。

TypeError: Cannot read property 'on' of undefined
    at Promise (/mnt/d/Git/CoolCode/node_modules/hexo-all-minifier/lib/concatJS.js:117:18)
    at Promise._execute (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/debuggability.js:303:9)
    at Promise._resolveFromExecutor (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:79:10)
    at Promise.all.scripts.map.path (/mnt/d/Git/CoolCode/node_modules/hexo-all-minifier/lib/concatJS.js:114:16)
    at Array.map (<anonymous>)
    at Promise.all.then.then (/mnt/d/Git/CoolCode/node_modules/hexo-all-minifier/lib/concatJS.js:113:34)
    at tryCatcher (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:638:18)
    at Promise._resolveCallback (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:432:57)
    at Promise._settlePromiseFromHandler (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:524:17)
    at Promise._settlePromise (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:638:18)
    at PromiseArray._resolve (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise_array.js:126:19)
    at PromiseArray._promiseFulfilled (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise_array.js:144:14)
    at Promise._settlePromise (/mnt/d/Git/CoolCode/node_modules/bluebird/js/release/promise.js:574:26)

Error with image_minifier and css_minifier

My _config.yml:

[...]
html_minifier:
  enable: true
  exclude: []

css_minifier:
  enable: false
  exclude:
    - '*.min.css'

js_minifier:
  enable: true
  mangle: true
  output:
  compress:
  exclude:
    - '*.min.js'

image_minifier:
  enable: false
  interlaced: true
  multipass: true
  optimizationLevel: 9
  pngquant: true
  progressive: true
[...]

My package.json:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.2.0"
  },
  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-all-minifier": "0.0.13",
    "hexo-deployer-rsync": "^0.1.1",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-feed": "^1.1.0",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-seo-friendly-sitemap": "0.0.15",
    "hexo-generator-tag": "^0.2.0",
    "hexo-helper-simple-tagcloud": "^0.2.0",
    "hexo-renderer-ejs": "^0.2.0",
    "hexo-renderer-marked": "^0.2.10",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-server": "^0.2.0",
    "hexo-tag-googlecharts": "^1.0.2"
  }
}

image_minifier Error Output:

┌─[atrost@deblap01] - [~/Projects/websites/edenmal.net] - [2016-05-17 02:04:48]
└─[0] <> hexo server    
INFO  Start processing
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/ASCII-Link-Dump.md [ 1.15% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Docker-for-Admins-Workshop-Recap-Presentation.md [ 1.54% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Docker-for-Admins-Workshop.md [ 0.31% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/First-Post.md [ 1.06% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/In-search-of-a-webhosting.md [ 0.46% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Kubernetes-Presentation.md [ 2.18% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Online-Courses-Courses-everywhere.md [ 1.85% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Rant-about-Tutorials.md [ 0.13% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/SRCDS-Server-Restarter-Script.md [ 0.68% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Story-Time-No-1.md [ 0.45% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/TITLE-HERE-Story-Time-No-2.md [ 1.77% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/hello-world.md [ 0.41% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Docker-for-Admins-Workshop-v2.md [ 0.23% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/404.md [ -1.38% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/about/index.md [ 1.01% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/categories/index.html [ NaN% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/tags/index.html [ NaN% saved]
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
TypeError: Imagemin is not a constructor
    at /home/atrost/Projects/websites/edenmal.net/node_modules/hexo-all-minifier/lib/filter.js:122:28
    at tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:683:18)
    at Promise._fulfill (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:628:18)
    at Promise._resolveCallback (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:423:57)
    at Promise._settlePromiseFromHandler (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:514:17)
    at Promise._settlePromise (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:683:18)
    at Promise._fulfill (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:628:18)
    at /home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/nodeback.js:42:21
    at /home/atrost/Projects/websites/edenmal.net/node_modules/stream-to-array/index.js:54:9
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
FATAL Imagemin is not a constructor
TypeError: Imagemin is not a constructor
    at /home/atrost/Projects/websites/edenmal.net/node_modules/hexo-all-minifier/lib/filter.js:122:28
    at tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:683:18)
    at Promise._fulfill (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:628:18)
    at Promise._resolveCallback (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:423:57)
    at Promise._settlePromiseFromHandler (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:514:17)
    at Promise._settlePromise (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromise0 (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:604:10)
    at Promise._settlePromises (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:683:18)
    at Promise._fulfill (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:628:18)
    at /home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/nodeback.js:42:21
    at /home/atrost/Projects/websites/edenmal.net/node_modules/stream-to-array/index.js:54:9
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

css_minifier Error Output:

┌─[atrost@deblap01] - [~/Projects/websites/edenmal.net] - [2016-05-17 02:10:33]
└─[0] <> hexo clean; hexo server
INFO  Deleted database.
INFO  Start processing
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/ASCII-Link-Dump.md [ 1.15% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Docker-for-Admins-Workshop-Recap-Presentation.md [ 1.54% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Docker-for-Admins-Workshop.md [ 0.31% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/First-Post.md [ 1.06% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/In-search-of-a-webhosting.md [ 0.46% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Kubernetes-Presentation.md [ 2.18% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Online-Courses-Courses-everywhere.md [ 1.85% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Rant-about-Tutorials.md [ 0.13% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/SRCDS-Server-Restarter-Script.md [ 0.68% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Story-Time-No-1.md [ 0.45% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/TITLE-HERE-Story-Time-No-2.md [ 1.77% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/hello-world.md [ 0.41% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/_posts/Docker-for-Admins-Workshop-v2.md [ 0.23% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/404.md [ -1.38% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/about/index.md [ 1.01% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/categories/index.html [ NaN% saved]
INFO  update Optimize HTML: /home/atrost/Projects/websites/edenmal.net/source/tags/index.html [ NaN% saved]
INFO  Hexo is running at http://localhost:4000/. Press Ctrl+C to stop.
ERROR Asset render failed: bootstrap/css/bootstrap.min.css
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at new CleanCSS (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/node_modules/clean-css/lib/clean.js:55:130)
    at Compress.compress (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/build/compress.js:34:18)
    at exports.default (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/build/compress.js:11:49)
    at Function.More.compress (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/build/More.js:430:12)
    at Hexo.OptimizeCSS (/home/atrost/Projects/websites/edenmal.net/node_modules/hexo-all-minifier/lib/filter.js:56:26)
    at Hexo.tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/method.js:15:34)
    at /home/atrost/Projects/websites/edenmal.net/node_modules/hexo/lib/extend/filter.js:68:35
    at tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/reduce.js:145:18)
    at Object.gotAccum (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/reduce.js:134:25)
    at Object.tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromiseCtx (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:596:10)
    at Async._drainQueue (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/async.js:143:12)
    at Async._drainQueues (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/async.js:17:14)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)
INFO  update Optimize JS: /home/atrost/Projects/websites/edenmal.net/themes/hexadillax/source/js/jquery.backstretch.min.js [ 0.97% saved]
INFO  update Optimize JS: /home/atrost/Projects/websites/edenmal.net/themes/hexadillax/source/bootstrap/js/bootstrap.min.js [ 0.34% saved]
INFO  update Optimize JS: /home/atrost/Projects/websites/edenmal.net/themes/hexadillax/source/js/jquery-2.1.0.min.js [ 0.10% saved]
ERROR Asset render failed: css/style.css
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at new CleanCSS (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/node_modules/clean-css/lib/clean.js:55:130)
    at Compress.compress (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/build/compress.js:34:18)
    at exports.default (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/build/compress.js:11:49)
    at Function.More.compress (/home/atrost/Projects/websites/edenmal.net/node_modules/more-css/build/More.js:430:12)
    at Hexo.OptimizeCSS (/home/atrost/Projects/websites/edenmal.net/node_modules/hexo-all-minifier/lib/filter.js:56:26)
    at Hexo.tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Hexo.<anonymous> (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/method.js:15:34)
    at /home/atrost/Projects/websites/edenmal.net/node_modules/hexo/lib/extend/filter.js:68:35
    at tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Object.gotValue (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/reduce.js:145:18)
    at Object.gotAccum (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/reduce.js:134:25)
    at Object.tryCatcher (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:502:31)
    at Promise._settlePromise (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:559:18)
    at Promise._settlePromiseCtx (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/promise.js:596:10)
    at Async._drainQueue (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/async.js:143:12)
    at Async._drainQueues (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/atrost/Projects/websites/edenmal.net/node_modules/bluebird/js/release/async.js:17:14)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)
INFO  update Optimize JS: /home/atrost/Projects/websites/edenmal.net/themes/hexadillax/source/js/common.js [ 28.70% saved]
INFO  update Optimize JS: /home/atrost/Projects/websites/edenmal.net/themes/hexadillax/source/js/headroom.min.js [ 3.69% saved]
^CINFO  See you again

I'm getting the above error when image_minifer is enabled and the below error when having css_minifier enabled.
Disabling both image_minifer and css_minifier "removes" the errors.

For the image_minifier error: Do I need to install a missing dependency?
For the css_minifier error: Is this a problem caused by the theme I'm using? The error only occurs with css_minifier enabled.

When js_concator is enabled, the HTML in the code block is displayed incorrectly

my code in markdown:

\`\`\` html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>test</title>
</head>
<body>
  <header id="header" class="header">
  </header>
  <main id="main" class="main">
  </main>
  <footer id="footer" class="footer">
  </footer>
</body>
</html>
\`\`\`

if I enable js_concator, It will display incorrectly:

image

if I not enable js_concator, it will display normally:

image

My minifiers config:

all_minifier: true

js_concator:
  enable: true
  bundle_path: '/js/bundle.min.js'
  front: false
  silent: false

My package.json:

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "4.0.0"
  },
  "scripts": {
    "dev": "hexo clean && hexo s -p 8001 -o",
    "build": "hexo clean && hexo d -g"
  },
  "dependencies": {
    "hexo": "^4.0.0",
    "hexo-algolia": "^1.3.1",
    "hexo-all-minifier": "^0.5.3",
    "hexo-deployer-git": "^1.0.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-feed": "^1.2.2",
    "hexo-generator-index-pin-top": "^0.2.2",
    "hexo-generator-search": "^2.4.0",
    "hexo-generator-sitemap": "^2.0.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-pwa": "^0.1.3",
    "hexo-render-pug": "^2.1.4",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-markdown-it-plus": "^1.0.4",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3",
    "hexo-wordcount": "^6.0.1"
  }
}

js.concator throws 502 bad gateway error and html minifier blocks post pages

If I use "js.concator" ... true, then I get 502 bad gateway error... why?

js_concator: enable: true bundle_path: '/js/bundle.js' front: false

If I use html minifier then only my _post pages will NOT open.
If I use following settings, then everything works, only _post pages are NOT html minified. How to make html minifier work also for _post pages with "ignore_error: false"??

html_minifier: enable: true ignore_error: true exclude:

image optimizer breaks my svg

Hi,

I have a svg file containing image icon data:

<svg style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="icon-clock" viewBox="0 0 30 32">
<title>clock</title>
<path d="M14.848 5.28q-4.416 0-7.552 3.136t-3.136 7.584 3.136 7.584 7.552 3.104 7.584-3.104 3.136-7.584-3.136-7.584-7.584-3.136zM14.88 1.696q5.888 0 10.080 4.192t4.192 10.112-4.192 10.080-10.080 4.224-10.112-4.224-4.192-10.080 4.192-10.112 10.112-4.192zM19.712 18.272l-2.56 2.56-3.488-3.552q-0.608-0.544-0.608-1.312v-7.136h3.616v6.368z"></path>
</symbol>
<symbol id="icon-calendar" viewBox="0 0 30 32">
<title>calendar</title>
<path d="M2.272 29.728h5.152v-5.152h-5.152v5.152zM8.576 29.728h5.696v-5.152h-5.696v5.152zM2.272 23.424h5.152v-5.696h-5.152v5.696zM8.576 23.424h5.696v-5.696h-5.696v5.696zM2.272 16.576h5.152v-5.152h-5.152v5.152zM15.424 29.728h5.728v-5.152h-5.728v5.152zM8.576 16.576h5.696v-5.152h-5.696v5.152zM22.272 29.728h5.152v-5.152h-5.152v5.152zM15.424 23.424h5.728v-5.696h-5.728v5.696zM9.152 8v-5.152q0-0.224-0.192-0.384t-0.384-0.192h-1.152q-0.224 0-0.384 0.192t-0.192 0.384v5.152q0 0.224 0.192 0.416t0.384 0.16h1.152q0.224 0 0.384-0.16t0.192-0.416zM22.272 23.424h5.152v-5.696h-5.152v5.696zM15.424 16.576h5.728v-5.152h-5.728v5.152zM22.272 16.576h5.152v-5.152h-5.152v5.152zM22.848 8v-5.152q0-0.224-0.16-0.384t-0.416-0.192h-1.12q-0.224 0-0.416 0.192t-0.16 0.384v5.152q0 0.224 0.16 0.416t0.416 0.16h1.12q0.256 0 0.416-0.16t0.16-0.416zM29.728 6.848v22.88q0 0.928-0.704 1.6t-1.6 0.672h-25.152q-0.928 0-1.6-0.672t-0.672-1.6v-22.88q0-0.928 0.672-1.6t1.6-0.672h2.304v-1.728q0-1.184 0.832-2.016t2.016-0.832h1.152q1.184 0 2.016 0.832t0.832 2.016v1.728h6.848v-1.728q0-1.184 0.864-2.016t2.016-0.832h1.12q1.184 0 2.048 0.832t0.832 2.016v1.728h2.272q0.928 0 1.6 0.672t0.704 1.6z"></path>
</symbol>
<symbol id="icon-author" viewBox="0 0 23 32">
<title>author</title>
<path d="M11.296 15.968q4.448 0 7.584 3.168t3.136 7.552q0 1.504-1.056 2.56t-2.528 1.056h-14.272q-1.472 0-2.528-1.056t-1.056-2.56q0-4.416 3.136-7.552t7.584-3.168zM5.952 7.040q0-5.344 5.344-5.344 5.376 0 5.376 5.344 0 5.376-5.376 5.376-5.344 0-5.344-5.376z"></path>
</symbol>

<symbol id="icon-twitter" viewBox="0 0 30 32">
<title>twitter</title>
<path d="M28.928 7.296q-1.184 1.728-2.88 2.976 0 0.256 0 0.736 0 2.336-0.672 4.64t-2.048 4.448-3.296 3.744-4.608 2.624-5.792 0.96q-4.832 0-8.832-2.592 0.608 0.064 1.376 0.064 4.032 0 7.168-2.464-1.888-0.032-3.36-1.152t-2.048-2.848q0.608 0.096 1.088 0.096 0.768 0 1.536-0.192-2.016-0.416-3.328-1.984t-1.312-3.68v-0.064q1.216 0.672 2.624 0.736-1.184-0.8-1.888-2.048t-0.704-2.752q0-1.568 0.8-2.912 2.176 2.656 5.248 4.256t6.656 1.76q-0.16-0.672-0.16-1.312 0-2.4 1.696-4.064t4.064-1.696q2.528 0 4.224 1.824 1.952-0.384 3.68-1.408-0.672 2.048-2.56 3.2 1.664-0.192 3.328-0.896z"></path>
</symbol>

<symbol id="icon-github" viewBox="0 0 27 32">
<title>github</title>
<path d="M13.728 2.272q3.712 0 6.88 1.856t4.992 4.992 1.824 6.88q0 4.48-2.624 8.064t-6.752 4.96q-0.48 0.096-0.704-0.128t-0.224-0.544q0-0.032 0-1.376t0-2.4q0-1.728-0.928-2.528 1.024-0.096 1.824-0.32t1.696-0.704 1.44-1.184 0.96-1.856 0.352-2.688q0-2.144-1.408-3.68 0.672-1.632-0.128-3.648-0.512-0.16-1.472 0.192t-1.632 0.8l-0.672 0.416q-1.664-0.48-3.424-0.48t-3.456 0.48q-0.256-0.192-0.736-0.48t-1.504-0.704-1.504-0.224q-0.8 2.016-0.16 3.648-1.408 1.536-1.408 3.68 0 1.504 0.384 2.656t0.928 1.888 1.44 1.184 1.664 0.704 1.824 0.32q-0.672 0.64-0.864 1.856-0.384 0.16-0.8 0.256t-1.024 0.096-1.152-0.384-0.992-1.12q-0.352-0.576-0.864-0.928t-0.896-0.448l-0.352-0.032q-0.384 0-0.512 0.064t-0.096 0.224 0.16 0.256 0.224 0.192l0.128 0.096q0.384 0.192 0.768 0.672t0.576 0.928l0.192 0.416q0.224 0.672 0.768 1.088t1.184 0.544 1.248 0.096 0.992-0.032l0.416-0.096q0 0.704 0 1.6t0.032 0.96q0 0.32-0.256 0.544t-0.704 0.128q-4.128-1.376-6.752-4.96t-2.624-8.064q0-3.744 1.856-6.88t4.96-4.992 6.912-1.856zM5.184 21.984q0.064-0.128-0.096-0.224-0.192-0.032-0.256 0.032-0.032 0.128 0.128 0.224t0.224-0.032zM5.76 22.592q0.128-0.096-0.032-0.288-0.192-0.16-0.288-0.064-0.128 0.096 0.032 0.288t0.288 0.064zM6.272 23.392q0.192-0.128 0-0.352-0.128-0.224-0.288-0.096-0.16 0.096 0 0.32t0.288 0.128zM7.040 24.128q0.128-0.128-0.064-0.32-0.224-0.224-0.352-0.064-0.16 0.16 0.064 0.352 0.192 0.192 0.352 0.032zM8.064 24.576q0.032-0.192-0.256-0.288-0.256-0.064-0.32 0.128t0.224 0.288q0.256 0.096 0.352-0.128zM9.184 24.672q0-0.224-0.32-0.192-0.288 0-0.288 0.192 0 0.224 0.32 0.192 0.288 0 0.288-0.192zM10.208 24.512q-0.032-0.224-0.32-0.16-0.288 0.032-0.256 0.256t0.32 0.128 0.256-0.224z"></path>
</symbol>

<symbol id="icon-facebook" viewBox="0 0 18 32">
<title>facebook</title>
<path d="M17.12 0.224v4.704h-2.784q-1.536 0-2.080 0.64t-0.544 1.92v3.392h5.248l-0.704 5.28h-4.544v13.568h-5.472v-13.568h-4.544v-5.28h4.544v-3.904q0-3.328 1.856-5.152t4.96-1.824q2.624 0 4.064 0.224z"></path>
</symbol>

<symbol id="icon-mail" viewBox="0 0 32 32">
<title>mail</title>
<path d="M29.728 26.848v-13.696q-0.576 0.64-1.248 1.152-4.768 3.68-7.616 6.048-0.896 0.768-1.472 1.184t-1.536 0.896-1.824 0.416h-0.064q-0.832 0-1.824-0.416t-1.536-0.896-1.472-1.184q-2.816-2.368-7.616-6.048-0.672-0.512-1.248-1.152v13.696q0 0.224 0.192 0.416t0.384 0.16h26.304q0.224 0 0.384-0.16t0.192-0.416zM29.728 8.096v-0.448t-0.032-0.224-0.032-0.224-0.096-0.16-0.16-0.128-0.256-0.064h-26.304q-0.224 0-0.384 0.192t-0.192 0.384q0 3.008 2.656 5.088 3.424 2.688 7.136 5.632 0.128 0.096 0.64 0.544t0.8 0.672 0.8 0.544 0.896 0.512 0.768 0.16h0.064q0.352 0 0.768-0.16t0.896-0.512 0.8-0.544 0.8-0.672 0.64-0.544q3.712-2.944 7.168-5.632 0.96-0.768 1.792-2.080t0.832-2.336zM32 7.424v19.424q0 1.184-0.832 2.016t-2.016 0.864h-26.304q-1.152 0-2.016-0.864t-0.832-2.016v-19.424q0-1.184 0.832-2.016t2.016-0.832h26.304q1.184 0 2.016 0.832t0.832 2.016z"></path>
</symbol>


</defs>
</svg>

and after optimization, all that is left is:

<svg style="position:absolute;width:0;height:0" xmlns="http://www.w3.org/2000/svg" overflow="hidden"/>

not sure, what you can do, because you only call the other optimizers, but is it possible to add an exclude option for the image_minifier ?

here is my relevant config so far with exclude obviously not working:

html_minifier:
  enable: true
  ignore_error: false
  exclude:

css_minifier:
  enable: true
  exclude: 
    - '*.min.css'

js_minifier:
  enable: true
  mangle: true
  output:
  compress:
  exclude: 
    - '*.min.js'

image_minifier:
  enable: true
  interlaced: false
  multipass: false
  optimizationLevel: 2
  pngquant: true
  progressive: false
  exclude: 
    - '*.svg'

Only Minifies post content.

I was using hexo-html-minifier on hexo 3.1.1 which would work great on the full page. I later upgraded to hexo 3.2.0 which broke this behavior and only minified the post content under <div class="article-entry" itemprop="articleBody">.

I decided to install hexo-all-minifier to see if that would work and I end up with the same result.

It would appear that hexo 3.2.0 may have universally broken both minifiers, probably due to either an order of operations change or limiting content processed by the generators.

imagemin-mozjpeg couldn't install successfully on mac osx 10.11

The imagemin-mozjpeg package might not be installed in mac osx.

In my laptop it throws the errors as below:

⚠ mozjpeg pre-build test failed
  ℹ compiling from source
  ✖ Error: autoreconf -fiv && ./configure --disable-shared --prefix="/Users/lv/dev/workspace/github/o2/o2team.github.io/node_modules/mozjpeg/vendor" --bindir="/Users/lv/dev/workspace/github/o2/o2team.github.io/node_modules/mozjpeg/vendor" --libdir="/Users/lv/dev/workspace/github/o2/o2team.github.io/node_modules/mozjpeg/vendor" && make --jobs=4 && make install --jobs=4
Command failed: autoreconf -fiv
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal  --output=aclocal.m4t
Can't exec "aclocal": No such file or directory at /usr/local/Cellar/autoconf/2.69/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory

After doing some google staff, i found the answer here:

imagemin/imagemin-mozjpeg#1

In mac osx, we should install some extra packages, maybe you should add the instructions to the Readme file.

brew install libtool automake autoconf nasm

Option for minified CSS path?

I would like the minified CSS output to be [filename].min.css instead of just [filename].css.

Some performance tests and browsers key in on the .min to know that the file is minified.

Can't apply image_minifier

Got an ENOENT error with runing hexo g which only happen when i turn the image_minifier on.

image_minifier:
  enable: true
  interlaced: false
  multipass: true
  optimizationLevel: 2
  pngquant: false
  progressive: false
  silent: false
  exclude:
    - '*.svg'
FATAL {
  err: Error: Command failed with ENOENT: /Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg -baseline
  spawn /Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg ENOENT
      at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
      at onErrorNT (node:internal/child_process:480:16)
      at processTicksAndRejections (node:internal/process/task_queues:81:21) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'spawn /Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg',
    path: '/Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg',
    spawnargs: [ '-baseline' ],
    originalMessage: 'spawn /Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg ENOENT',
    shortMessage: 'Command failed with ENOENT: /Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg -baseline\n' +
      'spawn /Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg ENOENT',
    command: '/Users/Zkp/仓库/myweb/blog-cn/node_modules/hexo-all-minifier/node_modules/mozjpeg/vendor/cjpeg -baseline',
    exitCode: undefined,
    signal: undefined,
    signalDescription: undefined,
    stdout: <Buffer >,
    stderr: <Buffer >,
    failed: true,
    timedOut: false,
    isCanceled: false,
    killed: false
  }
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

Using image_minifier will cause the local service to fail

When the image is compressed, an error is printed in the log, and after some images are compressed, the process is interrupted and the service is stopped.

hexo version:

hexo: 3.9.0
hexo-cli: 2.0.0
os: Darwin 17.7.0 darwin x64
http_parser: 2.8.0
node: 10.16.0
v8: 6.8.275.32-node.52
uv: 1.28.0
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 64
nghttp2: 1.34.0
napi: 4
openssl: 1.1.1b
icu: 64.2
unicode: 12.1
cldr: 35.1
tz: 2019a

// package.json
  "dependencies": {
    "babel-runtime": "^6.26.0",
    "hexo": "^3.9.0",
    "hexo-all-minifier": "^0.5.3",
    "hexo-deployer-git": "^1.0.0",
    "hexo-generator-archive": "^0.1.5",
    "hexo-generator-baidu-sitemap": "^0.1.6",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-feed": "^1.2.2",
    "hexo-generator-index": "^0.2.1",
    "hexo-generator-search": "^2.4.0",
    "hexo-generator-sitemap": "^1.2.0",
    "hexo-generator-tag": "^0.2.0",
    "hexo-leancloud-counter-security": "^1.4.1",
    "hexo-related-popular-posts": "^3.0.6",
    "hexo-renderer-ejs": "^0.3.1",
    "hexo-renderer-marked": "^1.0.1",
    "hexo-renderer-stylus": "^0.3.3",
    "hexo-server": "^0.3.3",
    "hexo-symbols-count-time": "^0.6.0"
  }

Log info:

➜  blog hexo s -p 9001
INFO  Start processing
INFO  update Optimize IMG: images/algolia_logo.svg [ 0.61% saved]
INFO  update Optimize IMG: images/cc-by-nc-nd.svg [ 67.07% saved]
INFO  update Optimize IMG: images/cc-by-nc-sa.svg [ 66.35% saved]
INFO  update Optimize IMG: images/cc-by-nc.svg [ 67.80% saved]
INFO  update Optimize IMG: images/cc-by-nd.svg [ 67.57% saved]
INFO  update Optimize IMG: images/cc-by-sa.svg [ 67.16% saved]
INFO  update Optimize IMG: images/cc-zero.svg [ 33.52% saved]
INFO  update Optimize IMG: images/cc-by.svg [ 69.03% saved]
INFO  update Optimize IMG: images/quote-l.svg [ 45.62% saved]
INFO  update Optimize IMG: images/quote-r.svg [ 45.85% saved]
INFO  update Optimize IMG: images/logo.svg [ 73.07% saved]
FATAL Something's wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
Error: spawn /Users/anran/OneDrive/blog/node_modules/mozjpeg/vendor/cjpeg ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
INFO  update Optimize IMG: images/avatar.gif [ 0.45% saved]
INFO  update Optimize IMG: 2018/02/06/dev-zero-configuration-vscode/anima-4.gif [ 0.68% saved]
INFO  update Optimize IMG: 2018/02/06/dev-zero-configuration-vscode/anima-2.gif [ 0.13% saved]
INFO  update Optimize IMG: 2018/02/06/dev-zero-configuration-vscode/anima-7.gif [ 25.99% saved]
INFO  update Optimize IMG: 2018/02/06/dev-zero-configuration-vscode/anima-1.gif [ 0.00% saved]
INFO  update Optimize IMG: 2018/04/06/URL-to-browser/anima-1.gif [ 0.36% saved]
INFO  update Optimize IMG: 2018/02/06/dev-zero-configuration-vscode/anima-6.gif [ 12.28% saved]
INFO  update Optimize IMG: 2018/03/24/loading-pictures/anima-1.gif [ 0.09% saved]
INFO  Congratulations! Your are using the latest version of theme NexT.
INFO  update Optimize IMG: 2018/01/13/性能优化-前端性能优化/anima-1.gif [ 0.09% saved]
INFO  update Optimize IMG: 2017/12/23/关于点击下拉菜单模糊及可能造成boder上下一像素宽度不一的坑/bug.gif [ 9.91% saved]
INFO  update Optimize IMG: 2018/03/24/loading-pictures/diff-1.gif [ 3.17% saved]
INFO  update Optimize IMG: 2017/12/23/关于点击下拉菜单模糊及可能造成boder上下一像素宽度不一的坑/transition.gif [ 18.72% saved]
INFO  update Optimize IMG: 2018/03/24/loading-pictures/google-1.gif [ 3.16% saved]
INFO  update Optimize IMG: 2018/03/24/loading-pictures/diff-2.gif [ 2.19% saved]
INFO  update Optimize IMG: 2018/04/06/URL-to-browser/anima-2.gif [ 1.64% saved]
INFO  update Optimize IMG: 2018/01/15/性能优化-回流与重汇/repaint.gif [ 0.09% saved]

Can't install?

$ npm install hexo-all-minifier --save

> [email protected] postinstall C:\Users\Xin\Desktop\hexo\loafing\node_modules\gifsicle
> node lib/install.js

  ‼ getaddrinfo ENOENT raw.githubusercontent.com
  ‼ gifsicle pre-build test failed
  i compiling from source
  × Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -ivf"
'autoreconf' �����ڲ����ⲿ���Ҳ���ǿ����еij���
���������ļ���


    at C:\Users\Xin\Desktop\hexo\loafing\node_modules\execa\index.js:231:11
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Promise.all (index 0)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\hexo-blog-encrypt\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\hexo-admin\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Excellent repo, but too slow to compressing many images

I am using your repo for hexo + githubpage. Your repo is very cool since it helps us open website pages faster. However, the big problem is that it compresses every image in every hexo g.
When I have considerable number of images, it would be a disaster (too slow). Hope you can enhance it by ignoring those images had been compressed before in each hexo g.

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

UglifyJS dosen't work for me

当执行hexo clean & hexo g时,html和css压缩没问题,但是js全都压缩不了。下面是一部分的报错:

INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\affix.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\algolia-search.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\bootstrap.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\hook-duoshuo.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\exturl.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\motion.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\post-details.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\js.cookie.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\scroll-cookie.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\scrollspy.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\js\src\utils.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\lib\canvas-nest\canvas-nest.min.js
INFO  Cannot minify the js of D:\Blog\Hexo\hexo\themes\next\source\lib\canvas-ribbon\canvas-ribbon.js

我把这行代码改成了log.log('Cannot minify the js of ${path}' + result.error);,最后得到的报错信息全部都是TypeError: Cannot read property 'ast' of null。。。求帮助!

此外上面的报错还发现*.min.js的文件并没有被跳过?

主题是 NexT.Muse,以下是设置:

html_minifier:
  enable: true
  ignore_error: false
  exclude:
  minifyCSS: true
  minifyJS: true

css_minifier:
  enable: true
  exclude: 
    - '*.min.css'

js_minifier:
  enable: true
  mangle: true
  output:
  compress:
  exclude: 
    - '*.min.js'

image_minifier:
  enable: false

Nodejs版本是最新的6.10

ECONNRESET : thrown with image_minifier enable

When I enable image_minifier, few images are optimized and at one momert, this error is displayed.

# package.json
{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "hexo": {
    "version": "3.2.0"
  },
  "dependencies": {
    "hexo": "^3.2.0",
    "hexo-all-minifier": "0.0.12",
    "hexo-cli": "^1.0.1",
    "hexo-generator-archive": "^0.1.4",
    "hexo-generator-category": "^0.1.3",
    "hexo-generator-index": "^0.2.0",
    "hexo-generator-sitemap": "^1.1.2",
    "hexo-generator-tag": "^0.2.0",
    "hexo-migrator-wordpress": "^0.1.2",
    "hexo-renderer-ejs": "^0.2.0",
    "hexo-renderer-marked": "^0.2.10",
    "hexo-renderer-stylus": "^0.3.1",
    "hexo-server": "^0.2.0"
  }
}
# _config.yml
image_minifier:
  enable: true
  interlaced: false
  multipass: false
  optimizationLevel: 7
  pngquant: false
  progressive: false
$ hexo generate
INFO  Start processing
INFO  update Optimize HTML: /data/source/_drafts/docker-initiation.md [ 0.81% saved]
INFO  update Optimize HTML: /data/source/_posts/autocomplete-puissant-leger.md [ 0.35% saved]
INFO  update Optimize HTML: /data/source/_posts/behat-error-using-switchtoiframe.md [ 0.86% saved]
INFO  update Optimize HTML: /data/source/_posts/bonne-pratique-typer-parametres.md [ 0.25% saved]
INFO  update Optimize HTML: /data/source/_posts/gerer-cache-symfony2-doctrine2.md [ 0.28% saved]
INFO  update Optimize HTML: /data/source/_posts/gitlab-upgrade-error-problem-ssl-ca-cert.md [ -0.07% saved]
INFO  update Optimize HTML: /data/source/_posts/golang-extraire-les-donnees-dun-flux-rss.md [ -0.02% saved]
INFO  update Optimize HTML: /data/source/_posts/grunt-symfony-remplacer-assetic.md [ 0.08% saved]
INFO  update Optimize HTML: /data/source/_posts/here-we-go.md [ 0.57% saved]
INFO  update Optimize HTML: /data/source/_posts/implementer-userprovider.md [ 0.07% saved]
INFO  update Optimize HTML: /data/source/_posts/importer-sql-server-timestamp.md [ 0.23% saved]
INFO  update Optimize HTML: /data/source/_posts/injecter-du-twig-dans-du-javascript-assetic.md [ 0.15% saved]
INFO  update Optimize HTML: /data/source/_posts/mappingexception-class-y-sub-class-of-x-is-not-valid-entity-or-mapped-super-class.md [ -0.18% saved]
INFO  update Optimize HTML: /data/source/_posts/php-decompresser-archive-zip.md [ 0.22% saved]
INFO  update Optimize HTML: /data/source/_posts/php-encodage-error.md [ 0.30% saved]
INFO  update Optimize HTML: /data/source/_posts/php-enlever-les-caracteres-insecables.md [ -0.02% saved]
INFO  update Optimize HTML: /data/source/_posts/php-symfony2-iis.md [ 0.13% saved]
INFO  update Optimize HTML: /data/source/_posts/posgresql-postgis-geometry-type-doesnt-exist.md [ 0.29% saved]
INFO  update Optimize HTML: /data/source/_posts/raspberry-pi-gerer-lalimentation-des-ports-usb.md [ 0.71% saved]
INFO  update Optimize HTML: /data/source/_posts/script-php-high-performance.md [ 0.29% saved]
INFO  update Optimize HTML: /data/source/_posts/securitycontroller-implementation.md [ 0.12% saved]
INFO  update Optimize HTML: /data/source/_posts/soft-delete-comment-se-passer-de-gedmo-dans-symfony.md [ -0.08% saved]
INFO  update Optimize HTML: /data/source/_posts/sql-server-et-php.md [ 0.54% saved]
INFO  update Optimize HTML: /data/source/_posts/symfony2-bonnes-pratiques.md [ 0.70% saved]
INFO  update Optimize HTML: /data/source/_posts/symfony-recommandation-officielle.md [ 0.46% saved]
INFO  update Optimize HTML: /data/source/_posts/symfony2-bonne-pratique-deplacer-session.md [ 0.25% saved]
INFO  update Optimize HTML: /data/source/_posts/symfony2-service-container.md [ 0.36% saved]
INFO  update Optimize HTML: /data/source/_posts/tutoriel-docker-symfony-docker-compose.md [ 0.21% saved]
INFO  update Optimize HTML: /data/source/_posts/twig-accelerer-generation-templates.md [ 0.02% saved]
INFO  update Optimize HTML: /data/source/_posts/twig-include-performance.md [ 0.05% saved]
INFO  update Optimize HTML: /data/source/_posts/twig-render-controller-le-faux-bon-ami.md [ 0.37% saved]
INFO  update Optimize HTML: /data/source/_posts/typematrix-bepo-french-layout.md [ 1.61% saved]
INFO  update Optimize HTML: /data/source/_posts/virtualbox-peripherique-detecte.md [ 0.28% saved]
INFO  update Optimize HTML: /data/source/_posts/xcache-windows.md [ 0.57% saved]
INFO  update Optimize IMG: fancybox/[email protected] [ 16.48% saved]
INFO  update Optimize IMG: fancybox/fancybox_loading.gif [ 32.16% saved]
INFO  update Optimize IMG: php-symfony2-iis/php_iis-300x118.jpg [ 44.87% saved]
INFO  update Optimize IMG: soft-delete-comment-se-passer-de-gedmo-dans-symfony/doctrine.jpg [ 46.87% saved]
INFO  update Optimize IMG: symfony2-bonnes-pratiques/20-20.jpg [ 46.22% saved]
INFO  update Optimize IMG: raspberry-pi-gerer-lalimentation-des-ports-usb/raspberry_pi_Pi_USB_side_noted-2.jpg [ 61.92% saved]
INFO  update Optimize IMG: script-php-high-performance/binary_min.jpg [ 50.29% saved]
INFO  update Optimize IMG: css/fonts/fontawesome-webfont.svg [ 99.98% saved]
INFO  update Optimize IMG: grunt-symfony-remplacer-assetic/Symfony-Grunt.jpg [ 40.51% saved]
INFO  update Optimize IMG: xcache-windows/xcache.jpg [ 46.46% saved]
INFO  update Optimize IMG: fancybox/fancybox_overlay.png [ 90.53% saved]
INFO  update Optimize IMG: golang-extraire-les-donnees-dun-flux-rss/gopher.jpg [ 55.18% saved]
INFO  update Optimize IMG: css/images/banner.jpg [ 67.42% saved]
INFO  update Optimize IMG: autocomplete-puissant-leger/autocomplete.png [ 37.39% saved]
INFO  update Optimize IMG: fancybox/[email protected] [ 0.69% saved]
FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: read ECONNRESET
    at exports._errnoException (util.js:890:11)
    at Pipe.onread (net.js:552:26)
FATAL read ECONNRESET
Error: read ECONNRESET
    at exports._errnoException (util.js:890:11)
    at Pipe.onread (net.js:552:26)

OptimizeCSS doesn't work with execFilterSync

Filters can be executed with execFilter or execFilterSync, but in order to support synchronous execution, it appears the filter implementation must also be synchronous. I believe that making the filter synchronous won't have any ill-effects since execFilter wraps each filter in it's own promise.

I'm trying to call execFilterSync from a hexo helper, but helpers are always synchronous, and the filter blows up with an error. I can submit a PR to fix this.

YAML Exception when doing hexo g

Hi,

When I install this plug in, some errors come up.

  ⚠ The `/Users/fjsdof/projects/blog/node_modules/hexo-all-minifier/node_modules/imagemin-mozjpeg/node_modules/mozjpeg/vendor/cjpeg` binary doesn't seem to work correctly
  ⚠ mozjpeg pre-build test failed
  ℹ compiling from source
  ✖ Error: autoreconf -fiv && ./configure --disable-shared --prefix="/Users/fjsdof/projects/blog/node_modules/hexo-all-minifier/node_modules/imagemin-mozjpeg/node_modules/mozjpeg/vendor" --bindir="/Users/fjsdof/projects/blog/node_modules/hexo-all-minifier/node_modules/imagemin-mozjpeg/node_modules/mozjpeg/vendor" --libdir="/Users/fjsdof/projects/blog/node_modules/hexo-all-minifier/node_modules/imagemin-mozjpeg/node_modules/mozjpeg/vendor" && make --jobs=4 && make install --jobs=4
Command failed: /bin/sh -c autoreconf -fiv
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext

After that, I try to run

hexo g

There's a YAML parse error.

FATAL unidentified alias ".min.css" at line 82, column 16:
        - *.min.css
                   ^
YAMLException: unidentified alias ".min.css" at line 82, column 16:
        - *.min.css
                   ^

My hexo version:
├─┬ [email protected]
│ ├─┬ [email protected]

only the html generated from markdown is minimized

Hi,

I have already asked for help in hexojs/hexo#1841 with no success, maybe you can help me here.

The "after_render:html" filter where the html minifier is registered, is only called after the html generation from the "hexo-renderer-marked".
However I use the "hexo-renderer-ejs" for templating and the html generated by it is not minimized.

Do you know how can I minimize both outputs?

Thanks

Unexpected token: operator (>)

It seems that the js-minifier cannot recognize the lambda operator (=>)

Full stack trace:

ERROR Asset render failed: lib/canvas-ribbon/canvas-ribbon.js
SyntaxError: Unexpected token: operator (>)
    at JS_Parse_Error.get (eval at <anonymous> (/Users/wafer/Documents/wafer-li.github.io/node_modules/hexo-all-minifier/node_modules/uglify-js/tools/node.js:1:1), <anonymous>:86:23)
    at getFullErrorStack (/Users/wafer/Documents/wafer-li.github.io/node_modules/bunyan/lib/bunyan.js:1129:17)
    at Object.Logger.stdSerializers.err (/Users/wafer/Documents/wafer-li.github.io/node_modules/bunyan/lib/bunyan.js:1147:16)
    at /Users/wafer/Documents/wafer-li.github.io/node_modules/bunyan/lib/bunyan.js:873:50
    at Array.forEach (native)
    at Logger._applySerializers (/Users/wafer/Documents/wafer-li.github.io/node_modules/bunyan/lib/bunyan.js:865:35)
    at mkRecord (/Users/wafer/Documents/wafer-li.github.io/node_modules/bunyan/lib/bunyan.js:978:17)
    at Logger.<anonymous> (/Users/wafer/Documents/wafer-li.github.io/node_modules/bunyan/lib/bunyan.js:1044:19)
    at /Users/wafer/Documents/wafer-li.github.io/node_modules/hexo/lib/plugins/generator/asset.js:36:22
    at tryCatcher (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/Users/wafer/Documents/wafer-li.github.io/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)

canvas-ribbon.js at
https://github.com/iissnan/hexo-theme-next/blob/master/source/lib/canvas-ribbon/canvas-ribbon.js

Didn't install

ubuntu@investor_cab:~/blog$ npm install hexo-all-minifier --save
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

[email protected] postinstall /home/ubuntu/blog/node_modules/gifsicle
node lib/install.js

✔ gifsicle pre-build test passed successfully

[email protected] postinstall /home/ubuntu/blog/node_modules/jpegtran-bin
node lib/install.js

✔ jpegtran pre-build test passed successfully

[email protected] postinstall /home/ubuntu/blog/node_modules/mozjpeg
node lib/install.js

✔ mozjpeg pre-build test passed successfully

[email protected] postinstall /home/ubuntu/blog/node_modules/optipng-bin
node lib/install.js

✔ optipng pre-build test passed successfully

[email protected] postinstall /home/ubuntu/blog/node_modules/pngquant-bin
node lib/install.js

⚠ The /home/ubuntu/blog/node_modules/pngquant-bin/vendor/pngquant binary doesn't seem to work correctly
⚠ pngquant pre-build test failed
ℹ compiling from source
✔ pngquant pre-build test passed successfully
✖ Error: pngquant failed to build, make sure that libpng-dev is installed
at Promise.all.then.arr (/home/ubuntu/blog/node_modules/pngquant-bin/node_modules/bin-build/node_modules/execa/index.js:231:11)
at process._tickCallback (internal/process/next_tick.js:68:7)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node lib/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2018-12-18T13_40_32_962Z-debug.log

Linux Ubuntu 18.04

html没有压缩,其他都ok

我用默认配置的,但是html没有压缩,会不会是 hexo 新版本的问题?
我测试 hexo-html-minifier 也是没法压缩。

About Silent Mode

Sometimes minifier just output too many messages.

Could you implement a silent mode, only output message when Warning or Error occurs?

Error: write EOF

After run hexo s, some INFO update Optimize IMG......showed, and then

FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: write EOF
    at _errnoException (util.js:992:11)
    at WriteWrap.afterWrite [as oncomplete] (net.js:864:14)

this err showed up and hexo s is shutdown after another few line of INFO update Optimize IMG......

Error when minify js: Can't read property 'length' of undefined in optimizeJS

After update to the latest version (v0.2.2), the js minifier stops working.

The result returned from UglifyJS.minify doesn't have property code, which caused this error when trying to get length and calculate the percentage. Below is the actual content of result. It looks like fromString is not an option in uglify-es, and comment out that setting fixed the error.

{ error:
   { DefaultsError: `fromString` is not a supported option
       at DefaultsError.get (eval at <anonymous> (C:\github\Sonar-Website\node_modules\hexo-all-minifier\node_modules\uglify-es\to
ols\node.js:21:1), <anonymous>:79:23)
       at formatError (util.js:628:15)
       at formatValue (util.js:532:18)
       at formatProperty (util.js:786:15)
       at util.js:634:12
       at Array.map (native)
       at formatObject (util.js:633:15)
       at formatValue (util.js:573:16)
       at inspect (util.js:188:10)
       at exports.format (util.js:128:20)
       at Console.log (console.js:106:24)
       at Hexo.OptimizeJS (C:\github\Sonar-Website\node_modules\hexo-all-minifier\lib\optimizeJS.js:27:11)
       at Hexo.tryCatcher (C:\github\Sonar-Website\node_modules\bluebird\js\release\util.js:16:23)
       at Hexo.<anonymous> (C:\github\Sonar-Website\node_modules\bluebird\js\release\method.js:15:34)
       at C:\github\Sonar-Website\node_modules\hexo\lib\extend\filter.js:68:35
       at tryCatcher (C:\github\Sonar-Website\node_modules\bluebird\js\release\util.js:16:23)
     message: '`fromString` is not a supported option',
     defs:
      { compress: {},
        ecma: undefined,
        ie8: false,
        keep_fnames: false,
        mangle: {},
        nameCache: null,
        output: {},
        parse: {},
        sourceMap: false,
        timings: false,
        toplevel: false,
        warnings: false,
        wrap: false } } }

throws no submodule mapping found error when npm install

it throws errors when installing it.

npm ERR! git submodule -q update --init --recursive: fatal: no submodule mapping found in .gitmodules for path 'test/testSite'

pls help, i'm going to fork your project and add some cool features.

path is undefined

test.md

{% note default %}
#### Default Header
Welcome to [Hexo!](https://hexo.io)
{% endnote %}

{% note primary %}
#### Primary Header
**Welcome** to [Hexo!](https://hexo.io)
{% endnote %}

note tag from Next

Return error

INFO  update Optimize HTML: undefined [ 1.10% saved]
INFO  update Optimize HTML: undefined [ 1.01% saved]

path is undefined

Debugger in hexo-all-minifier\lib\optimizeHTML.js

... ...
log[options.silent ? 'debug' : 'info']('update Optimize HTML: %s [ %s saved]', path, saved + '%');
if (path == undefined) console.log(data);
... ...

Debugging results

INFO  update Optimize HTML: undefined [ 1.10% saved]
{
  text: '\n#### Default Header\n\nWelcome to [Hexo!](https://hexo.io)',
  engine: 'markdown'
}
INFO  update Optimize HTML: undefined [ 1.01% saved]
{
  text: '\n#### Primary Header\n\n**Welcome** to [Hexo!](https://hexo.io)',
  engine: 'markdown'
}

Why is it treated as a file?

html缩进没了

压缩之前是有缩进的(输入法全拼模式下按tab缩进)
image
压缩后没了
image

slient:false end up with no info output as usual

See the log

And the related config file

Only the

bunyan usage error: /home/travis/build/wafer-li/wafer-li.github.io/node_modules/bluebird/js/release/util.js:16: attempt to log with an unbound log method: `this` is:

happened.

html_minifier makes inline code disappear

Hi,

I installed this plugin and enabled the html_minifier, and all the code blocks in markdown disappeared after rendering and minifying. Then I disabled it, everything rendered fine.

So I wonder is it a bug of this plugin or hexo-html-minifier?

Here's my environment:

  • OS X 10.11.2
  • node 4.1.2
  • hexo-all-minifier 0.0.11
  • hexo-renderer-marked 0.2.8

An in-range update of html-minifier is breaking the build 🚨

The dependency html-minifier was updated from 3.5.20 to 3.5.21.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

html-minifier is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 11 commits.

  • 5494091 Version 3.5.21
  • c6ecb90 Support <!doctypehtml> in the parser
  • c3f5168 Update build
  • f625991 Merge pull request #970 from mathiasbynens/doctype
  • cf55c51 Merge pull request #965 from mathiasbynens/fix-ampersand
  • 7e8406e Use <!doctypehtml> (without the space) where possible
  • 9b0c7cc Prevent data loss when using decodeEntities
  • df720b3 handle clean-css errors correctly (#955)
  • dcb6941 fix STDIN handling of CLI (#956)
  • 1f8df44 fix --minify-urls in CLI (#957)
  • 2d34ad5 Update README.md (#954)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.