title: Webpack 2: cannot resolve module
body: <p>I have a project like this:</p>
  
  <pre><code>root/
      webpack-config.js
      app/
         app.js
         js/
           dep.js
      core/
          module.js
  </code></pre>
  
  <p>Here is the webpack config file:</p>
  
  <pre><code>module.exports = {
      entry: './app/app.js',
      output: {
          path: __dirname,
          filename: "[name]-bundle.js"
      },
      module: {
          loaders: [
              { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/     }          
          ]
      },
      resolve: {
        modulesDirectories: ['core']
      }
      ...
  </code></pre>
  
  <p>in app.js, I have:</p>
  
  <pre><code>import local_dep from './js/dep';
  import myModule from 'module';
  </code></pre>
  
  <p>This works as expected with webpack 1.x, but the myModule module isn't resolved with webpack 2, I'm getting "Module not found: can't resolve 'module' in ... \app".</p>
  
  <p>It seems the modulesDirectories entry is ignored and the base URL corresponds to the entry's folder.</p>
  
  <p>What can I do to make modules resolve correctly with webpack 2 ?</p>