title: Webpack does not recognizing react component
body: <p>I am getting following error while trying to build using webpack</p>
  <pre><code>ERROR in ./packages/chat/index.js 12:2
  Module parse failed: Unexpected token (12:2)
  You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
  | console.log('start rendering chat');
  | ReactDOM.render(
  &gt;   &lt;div&gt;
  |     &lt;Provider store={globalStore}&gt;
  |       &lt;ChatUi /&gt;
  </code></pre>
  <p>FILE --&gt;  webpack.config.js</p>
  <pre><code>const path = require('path');
  const appPath = suffix =&gt; path.resolve(__dirname, suffix);
  const entries = { chat: appPath('../packages/chat/index.js') };
  module.exports = {
    name: 'Library',
    entry: entries,
    output: {
      path: appPath('../dist'),
      libraryTarget: 'var',
      filename: '[name]/index.js'
    },
    mode: 'production',
    resolve: {
      extensions: ['.js']
    },
    module: {
      rules: [
        {
          test: /[\.js|\.jsx]$/, /* only load js and jsx files and ignore non js files */
          loader: 'babel-loader',
          exclude:path.resolve(__dirname, 'node_modules'),
          include: path.resolve(__dirname, './packages')
        },
        {
          test: /\.css$/,
          use: ['style-loader', 'css-loader']
        }]
    }
  };
  </code></pre>
  <p>FILE --&gt;  .babelrc</p>
  <pre><code>{
    &quot;presets&quot;: [&quot;es2015&quot;, &quot;react&quot;, &quot;stage-0&quot;]
  }
  </code></pre>
  <p>FILE --&gt; index.js</p>
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import ChatUi from '../../src/chatUi/ChatUi';
  import { Provider } from 'react-redux';
  import {globalStore} from '../../src/common/load-redux';
  
  console.log('start rendering chat');
  ReactDOM.render(
    &lt;div&gt;
      &lt;Provider store={globalStore}&gt;
        &lt;ChatUi /&gt;
      &lt;/Provider&gt;,
    &lt;/div&gt;,
    document.getElementById('chat')
  );
  </code></pre>
  <p>Already spent almost a whole day going through similar questions on stack overflow with no success. Getting frustrated now... :(</p>