Skip to content

Instantly share code, notes, and snippets.

@juanghurtado
Created January 20, 2012 13:33
Show Gist options
  • Save juanghurtado/1647388 to your computer and use it in GitHub Desktop.
Save juanghurtado/1647388 to your computer and use it in GitHub Desktop.
Rake tasks to compress CSS/JS through YUI Compressor
require 'nanoc3/tasks'
desc 'Compress CSS files in output/style directory using YUI Compressor'
task :css do
puts `find output/css -name '*.css' -exec java -jar ./lib/yuicompressor-2.4.2.jar --type css '{}' -o '{}' \\;`
end
desc 'Compress JavaScript files in output/script directory using YUI Compressor'
task :js do
puts `find output/js -name '*.js' -exec java -jar ./lib/yuicompressor-2.4.2.jar --type js '{}' -o '{}' \\;`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment