From e7c83663bc8bd0d6cba0b52267760fa70c9f0410 Mon Sep 17 00:00:00 2001 From: William Horton Date: Thu, 25 Aug 2016 06:32:11 -0400 Subject: [PATCH] Use most recent React version (#477) * 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. --- scripts/init.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/init.js b/scripts/init.js index a26ad799cfa..9b708fa7bb1 100644 --- a/scripts/init.js +++ b/scripts/init.js @@ -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 = {}; @@ -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'});