Skip to content

Commit d6e82c2

Browse files
committed
Fixes a silent crash when ejecting
1 parent b55a7d8 commit d6e82c2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Diff for: packages/react-scripts/scripts/eject.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ prompt(
100100

101101
const ownPackage = require(path.join(ownPath, 'package.json'));
102102
const appPackage = require(path.join(appPath, 'package.json'));
103-
const babelConfig = JSON.parse(
104-
fs.readFileSync(path.join(ownPath, '.babelrc'), 'utf8')
105-
);
106-
const eslintConfig = JSON.parse(
107-
fs.readFileSync(path.join(ownPath, '.eslintrc'), 'utf8')
108-
);
109103

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

155149
// Add Babel config
156150
console.log(` Adding ${cyan('Babel')} preset`);
157-
appPackage.babel = babelConfig;
151+
appPackage.babel = {
152+
presets: ['react-app'],
153+
};
158154

159155
// Add ESlint config
160156
console.log(` Adding ${cyan('ESLint')} configuration`);
161-
appPackage.eslintConfig = eslintConfig;
157+
appPackage.eslintConfig = {
158+
extends: 'react-app',
159+
};
162160

163161
fs.writeFileSync(
164162
path.join(appPath, 'package.json'),

0 commit comments

Comments
 (0)