Rails 3.2 and yui compressor

The Rails Guide in the asset pipeline says you can use a CSS yui compressor with:

config.assets.css_compressor = :yui 

However, I see no signs that he is really using it. Firstly, it doesnโ€™t matter if I have a humming compressor or not. For another, the concise output is the same whether I have this line or not.

I put a small debug line in actionpack-3.2.3/lib/sprockets/compressors.rb in the registered_css_compressor method, and this is the result when the css is compiled: #<Sass::Rails::CssCompressor:0x007fdef9f9fee0>

So, it looks like the configuration line is not running. Has anyone really used this option?

Update

Sass-rails shows that the choice is overridden:

 if app.config.assets.compress app.config.sass.style = :compressed app.config.assets.css_compressor = CssCompressor.new end 

If I comment on this, then it will actually try to start the yui compressor ... I am still checking the output to make sure it is correct.

+6
source share
1 answer

This is really a mistake in the rails. I created a patch and pull out a request to fix it.

+4
source

Source: https://habr.com/ru/post/916195/


All Articles