title: Webpack code splitting, relative URL
body: <p>I'm trying to write a library using webpack. I'm using code splitting with <code>require.ensure</code> in my main file. Problem is that it will try to resolve all chunks from base url. Is it possible to make it relative to entry-point? </p>
  
  <p>For example, I add my entry-point as </p>
  
  <pre><code>&lt;script src="node_modules/mylib/index.js"&gt;
  </code></pre>
  
  <p>When this file does <code>require.ensure('./dep.js')</code> it will try to load <code>/dep.js</code> instead of <code>node_modules/mylib/dep.js</code>.</p>
  
  <p>I've made a workaround by manipulating <code>&lt;base&gt;</code> tag, but it's really an ugly hack. I feel like there should be a more "webpacky" solution.</p>