mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Adding header + version number to -min.js
This commit is contained in:
11
Rakefile
11
Rakefile
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user