From 1a565fec26f1c79de7c64cbd8d3d6f400ca7dc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnar=20=C3=9E=C3=B3r=20Sveinsson?= Date: Sun, 7 Aug 2016 20:36:57 +0000 Subject: [PATCH] Allowing .jsx extensions in webpack --- config/webpack.config.dev.js | 6 +++--- config/webpack.config.prod.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index a3db11f8ec7..109f34f78e5 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 2a3b1a81868..3d5fcc8337d 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')