문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top