title: Webpack error: “You may need an appropriate loader to handle this file type”
body: <p>I get the following error "<strong>You may need appropriate loader to handle this file type</strong>" while using Webpack to compile ES6 and JSX files. </p>
  
  <p>Terminal ERROR:</p>
  
  <pre><code>You may need an appropriate loader to handle this file type.
  | import React from 'react';
  | import ReactDOM from 'react-dom';
  </code></pre>
  
  <p><strong>webpack.config.js</strong> looks like this,</p>
  
  <pre><code>module.exports = {
      entry: './main.js',
      output: {
          path: './',
          filename: 'index.js'
      },
      devServer: {
          inline: true,
          port: 2525
      },
      module: {
          loaders: [
              {
                  test: '/\.js$/',
                  exclude: /node_modules/,
                  loader: 'babel-loader'
                  query: {
                      presets: ['es2015','react']
                  }
              }
          ]
      }
  }
  </code></pre>
  
  <p><strong>main.js</strong> file contains,</p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  
  class App extends React.Component {
      render(){
          return &lt;h1&gt;Title text&lt;/h1&gt;
      }
  }
  ReactDOM.render(&lt;App/&gt;,document.getElementById('app'));
  </code></pre>
  
  <p><strong>package.json</strong> looks like this,</p>
  
  <pre><code>{
    "name": "react-webpack-es6",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "start": "webpack-dev-server"
    },
    "author": "",
    "license": "ISC",
    "dependencies": {
      "react": "^0.14.7",
      "react-dom": "^0.14.7"
    },
    "devDependencies": {
      "babel-core": "^6.7.4",
      "babel-loader": "^6.2.4",
      "babel-preset-es2015": "^6.6.0",
      "babel-preset-react": "^6.5.0",
      "babel-preset-stage-0": "^6.5.0",
      "webpack": "^1.12.14",
      "webpack-dev-server": "^1.14.1"
    }
  }
  </code></pre>
  
  <p>Let me know if I'm missing something here.</p>