chenzhutian / hexo-all-minifier

A plugin for Hexo that optimizes HTML, CSS, JS and imagages, and it can optionally deploys your blog.
MIT License
279 stars 30 forks source link

YAML Exception when doing hexo g #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

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: ├─┬ hexo@3.2.0 │ ├─┬ hexo-cli@1.0.1

gpoulet commented 8 years ago

Same problem for me :(

gpoulet commented 8 years ago

I've no error with that :

but it doesn't seem to work with HTML :S

sjaakvandenberg commented 8 years ago

Try putting your array element in quotes:

css_minifier:
  enable: true
  exclude:
    - '*.min.css'
ManfredHu commented 8 years ago

same problem

$ hexo generate --deploy FATAL YAMLException: unidentified alias ".min.css" at line 99, column 16:

chenzhutian commented 8 years ago

@sjaakvandenberg gave a solution, just try putting your array element in quotes. Actually there is no need to set exclude: - '*.min.css', since this is the default setting of hexo-all-minifier I will fix the example in README in case to any more misleading

longshilin commented 5 years ago

exclude: '*.min.css'is ok