Question

There is an existing munge option in JavascriptCompressor which is part of the Yui Compressor. Is there a way to pass custom settings to this compressor when configuring asset pipeline in Rails >= 3.1 app?

Was it helpful?

Solution

There is an easy way to do this. In your config/production.rb you need to set up YUI compressor with munge option:

config.assets.js_compressor  = YUI::JavaScriptCompressor.new(munge: true)

Make sure you have compression enabled in the same file:

config.assets.compress = true

And also clean all cached files after enabling this in tmp/cache/assets and public/assets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top