title: Importing react with webpack Error: Cannot resolve module 'react'
body: <p>I'm getting an error <code>Error: Cannot resolve module 'react'</code> (and react-dom) with webpack. This has to be the hardest project setup I've had to deal with and I'm really not sure why its not working. I've also checked for similar issues on so, and can't seem to find a solution.</p>
  
  <p><strong>webpack.config.js</strong></p>
  
  <pre><code>module.exports = {
    entry: './static/js/base/base.jsx',
    output: {
      path: __dirname + '/static/scripts',
      filename: 'bundle.js'
    },
    resolve: {
      extensions: ['', '.js', '.jsx']
    },
    module: {
      loaders: [
        {
          test: /\.jsx?$/,
          loader: 'babel',
          exclude: /node_modules/,
          query: {
            cacheDirectory: true,
            presets: ['react', 'es2015']
          }
        }
      ]
    }
  }
  </code></pre>
  
  <p><strong>base.jsx</strong></p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  
  class Navigation extends React.Component {
    // ...
    constructor(props) {
      super(props);
  
      [
        // Functions &amp; Event Handlers declaration
      ].forEach(method =&gt; { this[method] = this[method].bind(this); });
  
      this.state = {
        hello: 'Hello World!',
      };
    }
  
    render() {
      return (
        &lt;div&gt;
          &lt;div href="#" class="header item"&gt;
            WINPMP Login
          &lt;/div&gt;
          &lt;div class="right menu"&gt;
            &lt;a class="ui primary button item"&gt;Students&lt;/a&gt;
            &lt;a class="ui button item"&gt;Teachers&lt;/a&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      );
    }
  }
  
  React.render(&lt;Navigation/&gt;, document.getElementById('nav'));
  </code></pre>
  
  <p>I've run <code>npm install</code>, everything is there. Why won't it import properly? How can I make this work?</p>
  
  <p>And my package.json</p>
  
  <pre><code> "devDependencies": {
      "babel": "^6.5.2",
      "babel-core": "^6.11.4",
      "babel-loader": "^6.2.4",
      "babel-preset-es2015": "^6.9.0",
      "babel-preset-react": "^6.11.1",
      "bower": "^1.7.9",
      "react": "^15.2.1",
      "react-dom": "^15.2.1",
      "webpack": "^1.13.1",
      "webpack-dev-server": "^1.14.1"
    }
  </code></pre>