0

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.

Community
  • 1
  • 1
Bob Spryn
  • 17,742
  • 12
  • 68
  • 91

1 Answers1

2

The short answer: use the YUIJavaScriptCompressor. This Assetfile:

require "rake-pipeline-web-filters"
require "rake-pipeline-web-filters/helpers"

input "assets"
output "public"

match "**/*.js" do
  yui :munge => true
end

will take each JavaScript file in your assets directory and run it through the YUI JavaScript compressor with the munge option. By default, it will rename each *.js file to *.min.js.

dudleyf
  • 353
  • 2
  • 6