Skip to content

Commit

Permalink
Adding header + version number to -min.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Nov 8, 2010
1 parent 13993f4 commit 44d09ae
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
11 changes: 8 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
require 'rubygems'
require 'closure-compiler'

HEADER = /((^\s*\/\/.*\n)+)/

desc "Use the Closure Compiler to compress Underscore.js"
task :build do
js = File.open('underscore.js', 'r')
min = Closure::Compiler.new.compile(js)
File.open('underscore-min.js', 'w') {|f| f.write(min) }
source = File.read('underscore.js')
header = source.match(HEADER)
min = Closure::Compiler.new.compress(source)
File.open('underscore-min.js', 'w') do |file|
file.write header[1].squeeze(' ') + min
end
end

desc "Build the docco documentation"
Expand Down
41 changes: 24 additions & 17 deletions underscore-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions underscore.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Underscore.js 1.1.2
// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
Expand Down

0 comments on commit 44d09ae

Please sign in to comment.