Skip to content

Instantly share code, notes, and snippets.

@bobspryn
Created December 20, 2011 04:27
Show Gist options
  • Save bobspryn/1500257 to your computer and use it in GitHub Desktop.
Save bobspryn/1500257 to your computer and use it in GitHub Desktop.
Example of an uglifyJS filter for rake-pipeline
require "uglifier"
require "rake-pipeline-web-filters"
class UglifyFilter < Rake::Pipeline::Filter
def initialize()
super()
end
def generate_output(inputs, output)
inputs.each do |input|
output.write Uglifier.compile(input)
end
end
end
#file shortened
match "**/*.js" do
filter UglifyFilter
end
@bobspryn
Copy link
Author

Eventually the uglify filter will probably be added with lots of options to the rake-pipeline-web-filters, but for now this works for the basic call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment