paolochiodi / htmlcompressor

A work in progress port of google's htmlcompressor.jar
Other
152 stars 26 forks source link

Don't depend on YUI – but still support it! #14

Closed whitehat101 closed 10 years ago

whitehat101 commented 10 years ago

CSS/JS compression is disabled by default. Issue #13 complains that the version that the gemspec requires causes issues on windows and that it is three years old.

I'm working on a project that would like to use the HTML compressor, but has no use for the CSS/JS compression. Pulling in YUI makes just the project fatter.

I moved the YUI code into separate requires. If a user wants it, they just need to include the gem 'yui-compressor' and require 'htmlcompressor/yui' -- that will recreate the behavior of 0.0.7.

I also added requires for closure (based on the code in the test), and for just the css or js part of YUI.

If a user wanted, they could use YUI for CSS and Closure for JS:

gem 'htmlcompressor'
gem 'yui-compressor'
gem 'closure-compiler'
...
require 'htmlcompressor/yui/css'
require 'htmlcompressor/closure'
paolochiodi commented 10 years ago

Hi @whitehat101 thank you for the good work. I was looking to remove yui dependency for quite some time, but never acted.

I'm going to merge this pull-request but I'll make some changes before publishing a new version:

paolochiodi commented 10 years ago

FYI I just pushed the new version to rubygems