Closed ghazel closed 13 years ago
I'd like this as well. +1
You can try my fork with support of UglifyJS unless you're using Heroku.
For now, uglifier gem depends on therubyracer which does not compile on Heroku.
As of #132, Jammit now supports UglifyJS. It'll go out properly in the next release.
Excellent.
Now I can't deploy on heroku... I am not really found of jammit requiring all three engines.
It should check if it is present and throw an error, but not force engines.
+1 for Jammit attempting to require
all three libraries, catching the LoadError
s, and testing for defined?
constants when deciding if it can use a particular library ... but not sticking them into the runtime_dependencies
section of the .gemspec
.
Or even splitting Jammit into four gems: jammit
with no .gemspec
dependencies, jammit-uglify-adapter
, jammit-yui-compressor-adapter
, and jammit-google-closure-compiler-adapter
(with the obvious breakdowns of .gemspec
dependencies). This would be a breaking change, but for the better.
i think it would be nice to use something simple pure-ruby like jsmin plus simple regexp css minification by default. So, user who wants better compression just do require needed compressors engines before jammit in Gemfile.
I did a version of jammit that requires no other dependencies than the default YUI.
https://github.com/juggy/jammit/commit/4813bd1ac436df9a84bcaf0c07f8a09c5600e112
If Closure or Uglifier are found, they can be used.
File as an idea: Support UglifyJS ( https://github.com/mishoo/UglifyJS ) as a javascript_compressor option.
jQuery recently switched to using it, and reports are that is is faster and produces smaller and less buggy JS.