Skip to content

Commit

Permalink
Use most recent React version (#477)
Browse files Browse the repository at this point in the history
* Get latest version numbers of react and react-dom from npm before install.

* Run separate npm installs for react, react-dom, and react-test-renderer.

* Consolidate into a single npm install.

* Fix misplaced parenthesis, add missing semicolon.

* Add missing semicolon.
  • Loading branch information
wdhorton authored and gaearon committed Aug 25, 2016
1 parent 9e81d1c commit e7c8366
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ 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 || {};
['react', 'react-dom'].forEach(function (key) {
appPackage.dependencies[key] = ownPackage.devDependencies[key];
});

// Setup the script rules
appPackage.scripts = {};
Expand Down Expand Up @@ -52,6 +48,9 @@ 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',
'--save',
verbose && '--verbose'
].filter(function(e) { return e; });
var proc = spawn('npm', args, {stdio: 'inherit'});
Expand Down

0 comments on commit e7c8366

Please sign in to comment.