diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index a3db11f8ec..109f34f78e 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -66,7 +66,7 @@ module.exports = { }, resolve: { // These are the reasonable defaults supported by the Node ecosystem. - extensions: ['.js', '.json', ''], + extensions: ['.js', '.jsx', '.json', ''], alias: { // This `alias` section can be safely removed after ejection. // We do this because `babel-runtime` may be inside `react-scripts`, @@ -91,7 +91,7 @@ module.exports = { // It's important to do this before Babel processes the JS. preLoaders: [ { - test: /\.js$/, + test: /\.(js)x?$/, loader: 'eslint', include: paths.appSrc, } @@ -99,7 +99,7 @@ module.exports = { loaders: [ // Process JS with Babel. { - test: /\.js$/, + test: /\.(js)x?$/, include: paths.appSrc, loader: 'babel', query: require('./babel.dev') diff --git a/config/webpack.config.prod.js b/config/webpack.config.prod.js index 2a3b1a8186..3d5fcc8337 100644 --- a/config/webpack.config.prod.js +++ b/config/webpack.config.prod.js @@ -61,7 +61,7 @@ module.exports = { }, resolve: { // These are the reasonable defaults supported by the Node ecosystem. - extensions: ['.js', '.json', ''], + extensions: ['.js', '.jsx', '.json', ''], alias: { // This `alias` section can be safely removed after ejection. // We do this because `babel-runtime` may be inside `react-scripts`, @@ -86,7 +86,7 @@ module.exports = { // It's important to do this before Babel processes the JS. preLoaders: [ { - test: /\.js$/, + test: /\.(js)x?$/, loader: 'eslint', include: paths.appSrc } @@ -94,7 +94,7 @@ module.exports = { loaders: [ // Process JS with Babel. { - test: /\.js$/, + test: /\.(js)x?$/, include: paths.appSrc, loader: 'babel', query: require('./babel.prod')