title: Webpack multiple named chunks ignoring names at runtime
body: <p>I am having trouble with webpacks code splitting functionality. I am trying to have 2 named chunks for two routes in my application which are not often visited. mysite.com/settings and mysite.com/access.</p>
  
  <p>here is my webpack.config.coffee</p>
  
  <pre><code>module.exports =
  
    contentBase: "#{__dirname}/src/"
  
    cache: true
  
    entry:
      app: './src/coffee/app'
      head: './src/coffee/head'
  
    output:
      path: path.join(__dirname, 'build')
      publicPath: '/'
      filename: '[name].js'
      chunkFilename: '[name]-[chunkhash].js'
  
    plugins: []
  </code></pre>
  
  <p>And here is my router.coffee</p>
  
  <pre><code>access: (slug) -&gt;
  
      _this = @
      require.ensure ['../view/page/access-page.coffee'], (require) -&gt;
        AccessPage = require '../view/page/access-page.coffee'
        accessPage = AccessPage.getInstance()
        accessPage.render() unless accessPage.isRendered
        _this.showPage accessPage
      , 'access'
  
  
  settings: (slug) -&gt;
  
      _this = @
      require.ensure ['../view/page/settings-page.coffee'], (require) -&gt;
        SettingsPage = require '../view/page/settings-page.coffee'
        settingsPage = SettingsPage.getInstance()
        settingsPage.render() unless settingsPage.isRendered
        _this.showPage settingsPage
      , 'settings'
  </code></pre>
  
  <p>I am not using the webpack dev-server, instead I am watching simply by using the following cmd-line tool</p>
  
  <pre><code>webpack -d --progress --colors --watch
  </code></pre>
  
  <p>The problem is that it ignores the names when requiring the files, as you can see the format is '[name]-[hash].js' it generates files with the correct format e.g. settings-2j3nekj2n3ejkn2.js but during development, when I attempt to load the page, the browser complains that '-2j3nekj2n3ejkn2.js' cannot be found, somehow the mapping of the files, ignores the names. If I leave out the names, then it works.</p>
  
  <p>So the question is how can I setup mulitple named chunks correctly. Thanks in advance.</p>
  
  <p>Note I have checked out their examples in the docs at <a href="https://github.com/webpack/docs/wiki/code-splitting" rel="nofollow">https://github.com/webpack/docs/wiki/code-splitting</a></p>
  
  <p>and I have followed their optimization docs aswell at
  <a href="https://github.com/webpack/docs/wiki/optimization" rel="nofollow">https://github.com/webpack/docs/wiki/optimization</a></p>
  
  <p>But I am stuck</p>