Skip to content

Commit e5db038

Browse files
committed
Change the organization of react-source files to allow copy-less boot of react-rails
See reactjs/react-rails#254 for context
1 parent 49de80e commit e5db038

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

gem-react-source/react-source.gemspec

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,5 @@ gemspec = Gem::Specification.new do |s|
1717
s.authors = ['Paul O’Shannessy']
1818
s.email = ['[email protected]']
1919

20-
s.files = Dir[
21-
'build/react.js',
22-
'build/react.min.js',
23-
'build/react-with-addons.js',
24-
'build/react-with-addons.min.js',
25-
'build/JSXTransformer.js',
26-
'lib/react/source.rb'
27-
]
20+
s.files = %w(lib/react/source.rb) + Dir['build/**/*.js']
2821
end

grunt/tasks/gem-react-source.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ var src = 'gem-react-source/';
77
var dest = 'build/gem-react-source/';
88
var build = dest + 'build/';
99
var buildFiles = [
10-
'react.js', 'react.min.js', 'JSXTransformer.js',
11-
'react-with-addons.js', 'react-with-addons.min.js'
10+
['react.js', 'development/', 'react.js'],
11+
['react-with-addons.js', 'development-with-addons/', 'react.js'],
12+
['react.min.js', 'production/', 'react.js'],
13+
['react-with-addons.min.js', 'production-with-addons/', 'react.js'],
14+
['JSXTransformer.js', '', 'JSXTransformer.js']
1215
];
1316

1417
function buildRelease() {
@@ -31,9 +34,12 @@ function buildRelease() {
3134
});
3235

3336
// Make built source available inside npm package
34-
grunt.file.mkdir(build);
3537
buildFiles.forEach(function(file) {
36-
grunt.file.copy('build/' + file, build + file);
38+
var source = file[0];
39+
var destDir = build + file[1];
40+
var destPath = destDir + file[2];
41+
grunt.file.mkdir(destDir);
42+
grunt.file.copy('build/' + source, destPath);
3743
});
3844
}
3945

0 commit comments

Comments
 (0)