title: Dynamic base href link with webpack
body: <p>I just moved from systemjs to webpack as I moved to Angular-CLI.
  It used to work but it does not anymore.
  Here is what I have :</p>
  
  <p>In my index.html in </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;script type='text/javascript'&gt;
      var base = document.location.pathname.split('/')[1];
      document.write('&lt;base href="/' + base + '" /&gt;');
  &lt;/script&gt;
  </code></pre>
  
  <p>And I also added a "/" at the root of the few js files added bellow.</p>
  
  <p>Now that I'm on webpack, those files are loaded from somewhere else and I can't add this "/" anymore.
  So it is trying to load  them on <a href="http://www.exemple.com/it/xxx.js" rel="nofollow">http://www.exemple.com/it/xxx.js</a>, instead of <a href="http://www.exemple.com/xxx.js" rel="nofollow">http://www.exemple.com/xxx.js</a></p>
  
  <p>I've seen that I have to update something in webpack.config.js file but angular-cli guys have decided to put it in their module and not on the project root as usual.
  I know I could edit this file but I don't want to do it again everytime I update angular-cli.</p>
  
  <p>Is there a good way to do that ?</p>