documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Turn off CSS minification separately #162

Open yfeldblum opened 13 years ago

yfeldblum commented 13 years ago

There should be an option to turn off CSS minification separately from JS minification. CSS files should still be concatenated into a package, just unminified.

The reason is that the YUI CSS minifier is in Java, but Java is not installed on Heroku, so CSS minification on Heroku fails. If there were an option to disable CSS minification, then all the other benefits from Jammit (JS minification, JS concatenation, CSS concatenation, etc.) could be realized on Heroku.

Cheers!

jimmycuadra commented 13 years ago

+1. Is there a CSS minifier that doesn't require Java? We might be able to take a similar approach as we did with the JS minification using UglifyJS.

aaronchi commented 13 years ago

sprockets 2 in rails 3.1 is using a sass function to compress stylesheets:

Sass::Engine.new(source,
  :syntax => :scss, :style => :compressed
).render
glebm commented 13 years ago

I believe rainpress: http://code.google.com/p/rainpress/ is

glebm commented 13 years ago

The gem has one issue though: https://github.com/sprsquish/rainpress/issues

However, the whole code is only about 150 lines with comments, so it should be easy to fix

jashkenas commented 13 years ago

I'm afraid that there are no robust pure-Ruby CSS compressors out there that I'm aware of. If you read the source of Rainpress, I don't think it cuts the mustard.

That said, I'd be glad to take a patch that makes Sass a configurable option as a CSS compressor alternative to YUI.

jsmestad commented 12 years ago

Fixing this would also remove any dependency on Java when using this on Heroku.