Skip to content

Instantly share code, notes, and snippets.

@dnagir
Created November 8, 2011 03:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnagir/1346939 to your computer and use it in GitHub Desktop.
Save dnagir/1346939 to your computer and use it in GitHub Desktop.
Spine minimization
files = %w{ajax.js list.js local.js manager.js relation.js route.js spine.js tabs.js tmpl.js}
all = files.inject('') {|m, c| m + File.read("lib/#{c}") }
puts "Initial size: #{all.length / 1024}kb" # =>
require 'closure-compiler'
content = Closure::Compiler.new.compile all
puts "Compressed size: #{content.length / 1024}kb"
File.write('spine-min.js', content)
$ ruby min
Initial size: 49kb
Compressed size: 26kb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment