sinatra-minify icon indicating copy to clipboard operation
sinatra-minify copied to clipboard

YUI compressor

Open elado opened this issue 14 years ago • 3 comments

YUI compressor is much better than jsmin.

I'm not that familiar with github, otherwise I would have forked it, but here's a fix:

http://gist.github.com/422436

(changed only minify_js method)

And of course, put yuicompressor-2.4.2.jar in minify directory, downloadable at: http://yuilibrary.com/downloads/#yuicompressor

(I should really know how to use github :) )

Thanks.

elado avatar Jun 02 '10 14:06 elado

Yeah problem with using YUI is that we have to make sure every deployment also has java, which is a major assumption.

With Jsmin, it's just plain ruby.

I'm going to compare the compression ratios of both and see if it warrants itself enough to require java to do JS compression.

sinefunc avatar Jun 04 '10 07:06 sinefunc

It can always be inside begin/rescue with a warning if one doesn't have java. YUI compressed my file 20% more because it also obfuscates code (which is important for code protection).

elado avatar Jun 04 '10 09:06 elado

Ok we'll see what we can do with this. We're leaning towards environment vars though, something like

COMPRESSOR=/path/to/yui.jar rake minify

sinefunc avatar Jun 07 '10 03:06 sinefunc