根据这个问题:Setting up rake-pipeline for use with handlebars alongside Google App Engine
我一直在学习如何使用rake-pipeline来管理我的资产,以便与ember.js一起使用(在dudleyf的帮助下)。
我想知道的是我如何将构建过程中的minifier作为某种rake-pipeline过滤器。抱歉,因为我不熟悉Ruby,所以我可能需要更深入的解释。
答案 0 :(得分:2)
简答:使用YUIJavaScriptCompressor
。这Assetfile
:
require "rake-pipeline-web-filters"
require "rake-pipeline-web-filters/helpers"
input "assets"
output "public"
match "**/*.js" do
yui :munge => true
end
将获取assets
目录中的每个JavaScript文件,并使用munge
选项通过YUI JavaScript压缩器运行它。默认情况下,它会将每个*.js
文件重命名为*.min.js
。