Skip to content

Commit 07eec91

Browse files
committed
Vendor react assets instead of including react-source
1 parent 6f7988b commit 07eec91

File tree

13 files changed

+57145
-37
lines changed

13 files changed

+57145
-37
lines changed

.bowerrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory" : "vendor/"
3+
}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ Gemfile.lock
44
test/dummy/tmp
55
gemfiles/*.lock
66
*.swp
7+
/vendor/react

Rakefile

+20
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@ end
66

77
Bundler::GemHelper.install_tasks
88

9+
require 'pathname'
10+
namespace :react do
11+
task :update do
12+
FileUtils.rm_f('vendor/react/.bower.json')
13+
system('bower install react')
14+
assets_path = Pathname.new(File.dirname(__FILE__)).join('lib/assets/')
15+
copy_react_asset('JSXTransformer.js', assets_path.join('javascripts/JSXTransformer.js'))
16+
copy_react_asset('react.js', assets_path.join('react-source/development/react.js'))
17+
copy_react_asset('react.min.js', assets_path.join('react-source/production/react.js'))
18+
copy_react_asset('react-with-addons.js', assets_path.join('react-source/development-with-addons/react.js'))
19+
copy_react_asset('react-with-addons.min.js', assets_path.join('react-source/production-with-addons/react.js'))
20+
end
21+
22+
def copy_react_asset(source, destination)
23+
vendor_path = Pathname.new(File.dirname(__FILE__)).join('vendor/react')
24+
FileUtils.mkdir_p(destination.dirname.to_s)
25+
FileUtils.cp(vendor_path.join(source), destination.to_s)
26+
end
27+
end
28+
929
require 'appraisal'
1030
require 'rake/testtask'
1131

0 commit comments

Comments
 (0)