title: TypeError: path.replace is not a function
body: <pre><code>/node_modules/webpack/lib/TemplatedPathPlugin.js:72
          .replace(REGEXP_HASH, withHashLength(getReplacer(data.hash), data.hashWithLength))
           ^
  </code></pre>
  
  <p>I'm getting this error when running <code>webpack</code> - it seems that <code>path</code> is an object rather than a string, and the replace method is therefore not found. Can anyone shed light on this error? Here's my <code>webpack.config.js</code>:</p>
  
  <pre><code>var webpack = require('webpack');
  var path = require('path');
  
  var basePath = 'app';
  var outputFile = 'output.js';
  
  var config = {
  
      entry: basePath + '/index.js',
  
      output: {
          path: basePath,
          filename: outputFile
      },
  
      resolve: {
          extensions: ['', '.js']
      },
  
      module: {
          loaders: [{
              test: /\.js$/,
              exclude: /node_modules/,
              loader: 'babel-loader',
              query: {
                  presets: ['es2015']
              }
          }]
      }
  };
  
  module.exports = config;
  </code></pre>