diff --git a/lib/core/src/server/config/webpack.config.js b/lib/core/src/server/config/webpack.config.js index dbcb827d740..558bced1847 100644 --- a/lib/core/src/server/config/webpack.config.js +++ b/lib/core/src/server/config/webpack.config.js @@ -76,7 +76,7 @@ export default ({ configDir, quiet, babelOptions }) => { module: { rules: [ { - test: /\.js$/, + test: /\.jsx?$/, use: [ { loader: require.resolve('babel-loader'), @@ -99,7 +99,7 @@ export default ({ configDir, quiet, babelOptions }) => { resolve: { // Since we ship with json-loader always, it's better to move extensions to here // from the default config. - extensions: ['.js', '.json'], + extensions: ['.js', '.jsx', '.json'], // Add support to NODE_PATH. With this we could avoid relative path imports. // Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253 modules: ['node_modules'].concat(nodePaths), diff --git a/lib/core/src/server/config/webpack.config.prod.js b/lib/core/src/server/config/webpack.config.prod.js index c3a73ed8920..0d4ff07e30d 100644 --- a/lib/core/src/server/config/webpack.config.prod.js +++ b/lib/core/src/server/config/webpack.config.prod.js @@ -58,7 +58,7 @@ export default ({ configDir, babelOptions }) => { module: { rules: [ { - test: /\.js$/, + test: /\.jsx?$/, use: [ { loader: require.resolve('babel-loader'), @@ -81,7 +81,7 @@ export default ({ configDir, babelOptions }) => { resolve: { // Since we ship with json-loader always, it's better to move extensions to here // from the default config. - extensions: ['.js', '.json'], + extensions: ['.js', '.jsx', '.json'], // Add support to NODE_PATH. With this we could avoid relative path imports. // Based on this CRA feature: https://github.com/facebookincubator/create-react-app/issues/253 modules: ['node_modules'].concat(nodePaths),