我如何使用压缩器作为我的 rake-pipeline 资产工作流程的一部分
根据这个问题:设置 rake-pipeline 以与把手和 Google App Engine 一起使用
我一直在学习如何使用 rake-pipeline 来管理我的资产以供使用ember.js(在 dudleyf 的慷慨帮助下)。
我想知道的是如何将压缩器作为某种 rake-pipeline 过滤器合并到构建过程中。抱歉,我对 Ruby 不熟悉,所以我可能需要更深入的解释。
Per this question: Setting up rake-pipeline for use with handlebars alongside Google App Engine
I've been learning how to use rake-pipeline to manage my assets for use with ember.js (with the gracious help of dudleyf).
What I would like to know is how I might incorporate a minifier into the build process as some sort of rake-pipeline filter. Apologies as I'm not familiar with Ruby, so I might need a little more in depth explanation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

简短的回答:使用
YUIJavaScriptCompressor
。此Assetfile
:将获取
assets
目录中的每个 JavaScript 文件,并使用munge
选项通过 YUI JavaScript 压缩器运行它。默认情况下,它将每个*.js
文件重命名为*.min.js
。The short answer: use the
YUIJavaScriptCompressor
. ThisAssetfile
:will take each JavaScript file in your
assets
directory and run it through the YUI JavaScript compressor with themunge
option. By default, it will rename each*.js
file to*.min.js
.