ohroy / hexo-neat

auto Minify html、js、css and make it neat
74 stars 11 forks source link

exclude: '*.min.js' can not work #11

Closed lewky closed 4 years ago

lewky commented 6 years ago

I found config '*.min.js' cannot work. Should add prefix path like '**/'. It can work in my hexo-Next theme as follows:

neat_js:
  enable: true
  mangle: true
  output:
  compress:
  exclude:
    - '**/*.min.js'
inkss commented 4 years ago

这里,是 minimatch() 这个判断方法的问题,** 匹配了多个目录

https://github.com/rozbo/hexo-neat/blob/28969670e8aae5ca1f72d81ed91e4a4eaeb5d1ef/lib/filter.js#L83

yansheng836 commented 4 years ago

I used this plug-in in yilia theme. The following configuration is valid and should have been fixed later.

exclude:
    - '**/*.min.js'

I think this issue can be closed.