title: Webpack module-type sourcemaps are pointing to 'undefined' file
body: <p>I'm building an app with multiple widgets. These widgets are fairly big in size, so they are placed in separate sub-directories within the parent directory. The file structure looks something like this:</p>
  
  <pre><code>./
  +-- server/
  |
  +-- client/
  |
  +-- widget1/
  |
  +-- widget2/
  |
  +-- widget3/
  |
  +-- package.json
  +-- webpack.base.config 
  </code></pre>
  
  <p>Each widget is a module completely separated from the other client and widgets, and are developed on their own, with their own development servers, etc.</p>
  
  <hr>
  
  <p>Now the problem: when setting the <code>webpackConfig.devtool</code> to anything that uses <code>module</code> (ie. <code>cheap-module-source-map</code>), the widget files do not receive the correct source-maps. Instead they receive a filename/line number that looks like: <code>(index):40</code>. (or <code>webpack:///:40</code> when mousing over) When clicking on said file in chrome, it points me to a file with these contents:</p>
  
  <pre><code>undefined
  
  
  /** WEBPACK FOOTER **
   ** 
   **/
  </code></pre>
  
  <p>Now the incredibly weird thing about this is that even when building the client app, which brings all the widgets and the client-side code together, <strong>only</strong> the widget files have these messed up source-maps.</p>
  
  <p>The contents of each widget is simply a bunch of <code>.js</code> and <code>.scss</code> files, with an <code>index.html</code> and <code>development-server.js</code> for development. The client side code is virtually the same, expect for the development files.</p>
  
  <hr>
  
  <p>This is webpack-1, version 1.13.0.</p>
  
  <p>My <code>webpack.base.config</code> looks like such:</p>
  
  <pre><code>const babelQuery = {
    es2015: require.resolve('babel-preset-es2015'),
    react: require.resolve('babel-preset-react'),
  };
  
  function createQuery(...paths) {
    return paths.map(resolvePath =&gt; `presets[]=${resolvePath}`).join(',');
  }
  
  const fullQuery = createQuery(babelQuery.es2015, babelQuery.react);
  
  module.exports = {
    cache: true,
    context: __dirname,
    debug: true,
    devtool: '#cheap-module-source-map',
  
    entry: {},
  
    output: {},
  
    resolve: {
      extensions: ['', '.js', '.jsx'],
    },
  
    module: {
      loaders: [
        {
          test: /\.js$/,
          loader: `babel-loader?cacheDirectory,${createQuery(babelQuery.es2015)}`,
          exclude: /node_modules/,
        },
        {
          test: /\.jsx$/,
          loader: `react-hot-loader!babel-loader?cacheDirectory,${fullQuery}`,
          exclude: /node_modules/,
        },
        {
          test: /\.json$/,
          loader: 'json-loader',
        },
        {
          test: /\.scss$/,
          loader: 'style-loader' +
          '!css-loader?modules&amp;sourceMap&amp;localIdentName=[name]__[local]___[hash:base64:5]' +
          '!postcss-loader!sass-loader?outputStyle=expanded&amp;sourceMap',
        },
        {
          test: /\.(png|jpg|gif)$/,
          loader: 'file-loader?name=img/[name].[ext]',
        },
        {
          test: /\.(ttf|eot|svg|woff(2)?)(\?v=\d+\.\d+\.\d+)?(\?[a-z0-9]+)?$/,
          loader: 'file-loader',
        },
        {
          test: /\.css$/,
          loader: 'style-loader!css-loader?modules&amp;localIdentName=[name]__[local]___[hash:base64:5]',
          include: /flexboxgrid/,
        },
        {
          test: /\.css$/,
          loader: 'style-loader!css-loader',
          exclude: /flexboxgrid/,
        },
      ],
    },
  
    postcss() {
      return [autoprefixer];
    },
  
    plugins: [
      new webpack.HotModuleReplacementPlugin(),
      new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify('development'),
        },
      }),
    ],
  };
  </code></pre>
  
  <p>The widgets' development servers modify the base config like so: (if it matters)</p>
  
  <pre><code>  context: __dirname,
    entry: {
      bundle: [
        'webpack/hot/dev-server',
        'webpack-hot-middleware/client',
        './entry.jsx',
      ],
    },
    output: {
      path: path.resolve(__dirname, 'dist'),
      publicPath: `http://localhost:${PORT}/assets/`,
      filename: '[name].js',
    },
  </code></pre>