Commit ccb5f84d authored by Dan Abramov's avatar Dan Abramov Committed by Joe Haddad
Browse files

Fixes a silent crash when ejecting (#1810)

* Fixes a silent crash when ejecting

* Delete unnecessary files

* Remove references to eslintrc in Webpack config

* Fix lint

* Correct ESLint CLI options
parent b55a7d80
4 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file,!1933Add note about installing watchman
Showing with 12 additions and 28 deletions
+12 -28
{
"presets": ["react-app"]
}
\ No newline at end of file
...@@ -19,11 +19,6 @@ const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeM ...@@ -19,11 +19,6 @@ const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeM
const getClientEnvironment = require('./env'); const getClientEnvironment = require('./env');
const paths = require('./paths'); const paths = require('./paths');
// @remove-on-eject-begin
// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
const path = require('path');
// @remove-on-eject-end
// Webpack uses `publicPath` to determine where the app is being served from. // Webpack uses `publicPath` to determine where the app is being served from.
// In development, we always serve from the root. This makes config easier. // In development, we always serve from the root. This makes config easier.
const publicPath = '/'; const publicPath = '/';
...@@ -121,7 +116,9 @@ module.exports = { ...@@ -121,7 +116,9 @@ module.exports = {
// @remove-on-eject-begin // @remove-on-eject-begin
// Point ESLint to our predefined config. // Point ESLint to our predefined config.
options: { options: {
configFile: path.join(__dirname, '../eslintrc'), baseConfig: {
extends: ['react-app'],
},
useEslintrc: false, useEslintrc: false,
}, },
// @remove-on-eject-end // @remove-on-eject-end
......
...@@ -19,11 +19,6 @@ const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin'); ...@@ -19,11 +19,6 @@ const InterpolateHtmlPlugin = require('react-dev-utils/InterpolateHtmlPlugin');
const paths = require('./paths'); const paths = require('./paths');
const getClientEnvironment = require('./env'); const getClientEnvironment = require('./env');
// @remove-on-eject-begin
// `path` is not used after eject - see https://github.com/facebookincubator/create-react-app/issues/1174
const path = require('path');
// @remove-on-eject-end
// Webpack uses `publicPath` to determine where the app is being served from. // Webpack uses `publicPath` to determine where the app is being served from.
// It requires a trailing slash, or the file assets will get an incorrect path. // It requires a trailing slash, or the file assets will get an incorrect path.
const publicPath = paths.servedPath; const publicPath = paths.servedPath;
...@@ -122,7 +117,9 @@ module.exports = { ...@@ -122,7 +117,9 @@ module.exports = {
options: { options: {
// TODO: consider separate config for production, // TODO: consider separate config for production,
// e.g. to enable no-console and no-debugger only in production. // e.g. to enable no-console and no-debugger only in production.
configFile: path.join(__dirname, '../eslintrc'), baseConfig: {
extends: ['react-app'],
},
useEslintrc: false, useEslintrc: false,
}, },
// @remove-on-eject-end // @remove-on-eject-end
......
{
"extends": "react-app"
}
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
"url": "https://github.com/facebookincubator/create-react-app/issues" "url": "https://github.com/facebookincubator/create-react-app/issues"
}, },
"files": [ "files": [
"babelrc",
"eslintrc",
"bin", "bin",
"config", "config",
"scripts", "scripts",
......
...@@ -100,12 +100,6 @@ prompt( ...@@ -100,12 +100,6 @@ prompt(
const ownPackage = require(path.join(ownPath, 'package.json')); const ownPackage = require(path.join(ownPath, 'package.json'));
const appPackage = require(path.join(appPath, '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')); console.log(cyan('Updating the dependencies'));
const ownPackageName = ownPackage.name; const ownPackageName = ownPackage.name;
...@@ -154,11 +148,15 @@ prompt( ...@@ -154,11 +148,15 @@ prompt(
// Add Babel config // Add Babel config
console.log(` Adding ${cyan('Babel')} preset`); console.log(` Adding ${cyan('Babel')} preset`);
appPackage.babel = babelConfig; appPackage.babel = {
presets: ['react-app'],
};
// Add ESlint config // Add ESlint config
console.log(` Adding ${cyan('ESLint')} configuration`); console.log(` Adding ${cyan('ESLint')} configuration`);
appPackage.eslintConfig = eslintConfig; appPackage.eslintConfig = {
extends: 'react-app',
};
fs.writeFileSync( fs.writeFileSync(
path.join(appPath, 'package.json'), path.join(appPath, 'package.json'),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment