Skip to content

Commit

Permalink
Fixes a silent crash when ejecting
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Mar 13, 2017
1 parent b55a7d8 commit d6e82c2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ prompt(

const ownPackage = require(path.join(ownPath, 'package.json'));
const appPackage = require(path.join(appPath, 'package.json'));
const babelConfig = JSON.parse(
fs.readFileSync(path.join(ownPath, '.babelrc'), 'utf8')
);
const eslintConfig = JSON.parse(
fs.readFileSync(path.join(ownPath, '.eslintrc'), 'utf8')
);

console.log(cyan('Updating the dependencies'));
const ownPackageName = ownPackage.name;
Expand Down Expand Up @@ -154,11 +148,15 @@ prompt(

// Add Babel config
console.log(` Adding ${cyan('Babel')} preset`);
appPackage.babel = babelConfig;
appPackage.babel = {
presets: ['react-app'],
};

// Add ESlint config
console.log(` Adding ${cyan('ESLint')} configuration`);
appPackage.eslintConfig = eslintConfig;
appPackage.eslintConfig = {
extends: 'react-app',
};

fs.writeFileSync(
path.join(appPath, 'package.json'),
Expand Down

0 comments on commit d6e82c2

Please sign in to comment.