Skip to content

Commit

Permalink
Fixes jashkenas#2143, Add a source map for backbone-min.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Mar 19, 2013
1 parent 46bf8c8 commit 71f4359
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 57 deletions.
17 changes: 2 additions & 15 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
require 'rubygems'

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

desc "rebuild the backbone-min.js files for distribution"
task :build do
begin
require 'closure-compiler'
rescue LoadError
puts "closure-compiler not found.\nInstall it by running 'gem install closure-compiler'"
exit
end
source = File.read 'backbone.js'
header = source.match(HEADER)
File.open('backbone-min.js', 'w+') do |file|
file.write header[1].squeeze(' ') + Closure::Compiler.new.compress(source)
end
check 'uglifyjs', 'UglifyJS', 'https://github.com/mishoo/UglifyJS2'
system 'uglifyjs backbone.js --source-map backbone-min.map -o backbone-min.js'
end

desc "build the docco documentation"
Expand Down
46 changes: 4 additions & 42 deletions backbone-min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 71f4359

Please sign in to comment.