title: Module not found: Error: Can't resolve 'react'
body: <p>I'm trying to add react to exist project with webpack.
  After </p>
  
  <pre><code>npm i react --save
  </code></pre>
  
  <p>I've add </p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  </code></pre>
  
  <p>to webpack app.js that contains all imports</p>
  
  <p>But when I run </p>
  
  <pre><code>npm run build 
  </code></pre>
  
  <p>I've got an error </p>
  
  <p>ERROR in ./Project.Web/webpack/app.js                                                                               </p>
  
  <pre><code>Module not found: Error: Can't resolve 'react' in 'C:\source\Project.Web\webpack'
   @ ./Project.Web/webpack/app.js 330:0-26
  </code></pre>
  
  <p>So I guess a reason could be in webpack config 
  In project there is webpack.common.config.js. I'm new in webpack but I'm surprised that there are no any ref to node_modules. So how it should be? </p>
  
  <pre><code>var path = require("path");
  var webpack = require("webpack");
  
  module.exports = {
      resolve: {
          alias: {
              React: path.resolve(__dirname, '../node_modules')
              jquery: path.resolve(__dirname, '../Project.Web/SharedComponents/Components/jquery/jquery-1.11.3'),
              d3: path.resolve(__dirname, "../Project.WebU/SharedComponents/Components/d3/d3.js"),
              d3Tip: path.resolve(__dirname, "../Project.Web/SharedComponents/Components/d3/d3.tip.v0.6.3.js"),
              underscore: path.resolve(__dirname, "../Project.Web/SharedComponents/Components/underscore/underscore.js"),
              hb: path.resolve(__dirname, "../Project.Web/SharedComponents/Components/handlebars/handlebars-v4.0.11.js"),
          },
          modules: [
              path.resolve(__dirname, "../Project.Web"),
              path.resolve(__dirname, "../Project.Web/SharedComponents"),
              path.resolve(__dirname, "./")
          ],
          extensions: ['.js']
      },
  
      module: {
          rules: [{
                  test: require.resolve('../Project.Web/SharedComponents/Components/jquery/jquery-1.11.3'),
                  use: [{
                          loader: 'expose-loader',
                          options: '$'
                      },
                      {
                          loader: 'expose-loader',
                          options: 'jQuery'
                      }
                  ]
              },
              {
                  test: require.resolve("../Project.Web/SharedComponents/Components/d3/d3.js"),
                  use: [{
                      loader: 'expose-loader',
                      options: 'd3'
                  }]
              }
          ]
      },
  
  
      plugins: [
          new webpack.ProvidePlugin({
              $: "jquery",
              jquery: "jquery",
              jQuery: "jquery",
              "window.jquery": "jquery",
              "window.jQuery": "jquery",
              "window.$": "jquery",
              "d3": "d3",
              "d3.tip": "d3Tip",
              "_": "underscore",
              "Handlebars": "hb",
              "PubSub": "PubSub",
              "bootbox": "bootbox",
              "Mprogress": "Mprogress",
              "zxcvbn": "zxcvbn",
  
          })
      ]
  };
  </code></pre>