chenzhutian / hexo-all-minifier

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

OptimizeCSS doesn't work with execFilterSync #31

Closed stephencroberts closed 6 years ago

stephencroberts commented 6 years ago

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.