Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JavascriptCompressor 中有一个现有munge选项,它是 Yui Compressor 的一部分。在 Rails >= 3.1 应用程序中配置资产管道时,有没有办法将自定义设置传递给此压缩器?
munge
有一个简单的方法可以做到这一点。在您config/production.rb需要设置带有 munge 选项的 YUI 压缩器:
config/production.rb
config.assets.js_compressor = YUI::JavaScriptCompressor.new(munge: true)
确保在同一个文件中启用了压缩:
config.assets.compress = true
并且在tmp/cache/assets和public/assets.
tmp/cache/assets
public/assets