Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use most recent React version #477

Merged
merged 5 commits into from
Aug 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,10 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
var ownPath = path.join(appPath, 'node_modules', 'react-scripts');

var appPackage = require(path.join(appPath, 'package.json'));
var ownPackage = require(path.join(ownPath, 'package.json'));

// Copy over some of the devDependencies
appPackage.dependencies = appPackage.dependencies || {};
appPackage.devDependencies = appPackage.devDependencies || {};
['react', 'react-dom'].forEach(function (key) {
appPackage.dependencies[key] = ownPackage.devDependencies[key];
});
['react-test-renderer'].forEach(function (key) {
appPackage.devDependencies[key] = ownPackage.devDependencies[key];
});

// Setup the script rules
appPackage.scripts = {};
Expand Down Expand Up @@ -74,6 +67,10 @@ module.exports = function(appPath, appName, verbose, originalDirectory) {
// TODO: having to do two npm installs is bad, can we avoid it?
var args = [
'install',
'react',
'react-dom',
'react-test-renderer',
'--save',
verbose && '--verbose'
].filter(function(e) { return e; });
var proc = spawn('npm', args, {stdio: 'inherit'});
Expand Down