title: Output JS file of Webpack is not accessible in subdirectories
body: <p>I am generating a output JS file named <code>transformed.js</code> through webpack. But there is a problem with the way it is injecting it in html file. In HTML file, it is not including a slash in front of this file. Due to which if I move to any subdirectory then browser fails to find <code>transformed.js</code> because it starts looking for this file in that subdirectory. I am attaching screenshot of error for better clarification</p>
  
  <p><a href="https://i.stack.imgur.com/ApU1q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ApU1q.png" alt="enter image description here"></a></p>
  
  <p>It is happening because in HTML file it is getting injected like this </p>
  
  <pre><code>&lt;script type="text/javascript" src="transformed.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>But ideally it should be getting injected like this</p>
  
  <pre><code>&lt;script type="text/javascript" src="/transformed.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>My Webpack configfuration is this</p>
  
  <pre><code>var HTMLWebpackPlugin = require('html-webpack-plugin');
  var HTMLWebpackPluginConfig = new HTMLWebpackPlugin({
      template: __dirname + '/app/index.html',
      filename: 'index.html',
      inject: 'body'
  });
  module.exports = {
      entry: __dirname + "/app/index.js",
      module: {
          loaders: [
              {
                  test: /\.js$/,
                  exclude: /node_modules/,
                  loader: 'babel-loader'
              },
              { 
                  test: /\.css$/, 
                  loader: "style-loader!css-loader" 
              },
              {
                  test: /\.svg$/,
                  loader: 'react-svg'
              },
              { 
                  test: /\.(png|jpg)$/, 
                  loader: 'url-loader?limit=88192'
              }
          ]
      },
      devServer: {
          historyApiFallback: true,
          contentBase: './'
      },
      output: {
          filename: 'transformed.js',
          path: __dirname + '/build'
      },  
      plugins: [HTMLWebpackPluginConfig]
  };
  </code></pre>
  
  <p>Please suggest how can I fix this?</p>