remove the advanced_optimizations concessions and the advanced_optimizations rake task. Simple will do.

This commit is contained in:
Jeremy Ashkenas
2010-02-24 12:16:45 -05:00
parent 69bb3490b3
commit 2c8fbe7875
2 changed files with 48 additions and 80 deletions

View File

@@ -1,6 +1,6 @@
require 'rubygems'
require 'closure-compiler'
desc "Use the Closure Compiler to compress Underscore.js"
task :build do
js = File.open('underscore.js', 'r')
@@ -8,20 +8,3 @@ task :build do
File.open('underscore-min.js', 'w') {|f| f.write(min) }
end
task :build_advanced do
js = File.read('underscore.js')
# remove wrapping anonymous function as this messes with closure compiler
# see
# http://groups.google.com/group/closure-compiler-discuss/browse_thread/thread/b59b54c1a0073aa5
js.sub!('(function() {', '').chomp!("_.initWrapper();\n})();\n")
compiler = Closure::Compiler.new \
:compilation_level => 'ADVANCED_OPTIMIZATIONS',
:formatting => 'PRETTY_PRINT'
min = compiler.compile(js)
File.open('underscore-min2.js', 'w') {|f| f.write(min) }
#
original_size = js.length
minimized_size = min.length
puts original_size, minimized_size
end