Skip to content

Instantly share code, notes, and snippets.

@lukemelia
Created June 20, 2012 04:04
Show Gist options
  • Save lukemelia/2958072 to your computer and use it in GitHub Desktop.
Save lukemelia/2958072 to your computer and use it in GitHub Desktop.
Example rake-pipeline Assetfile
require "rake-pipeline-web-filters"
class ClosureFilter < Rake::Pipeline::Filter
def generate_output(inputs, output)
inputs.each do |input|
output.write "(function() { #{input.read} })()"
end
end
end
UglifyFilter = Rake::Pipeline::Web::Filters::UglifyFilter
ConcatFilter = Rake::Pipeline::ConcatFilter
output "dist"
input "app", "**/*.js" do
filter ClosureFilter
filter UglifyFilter
filter ConcatFilter, "application.js"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment