title: How to fix require.ensure error Webpack, Babel6, React?
body: <p>I trying to use require.ensure to create a chunk for Facility.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import { render } from 'react-dom';
  class Facility extends Component {
      constructor(...args) {
          super(...args);
          this.state = {
                ....
          };
      }
      render() {
          return (
              &lt;div&gt;
                        ....
              &lt;/div&gt;
          );
      }
  }
  
  export default Facility;
  //Tried module.exports = Facility;
  </code></pre>
  
  <p><strong>NonPatientSer.js</strong></p>
  
  <pre><code>var Facility;
  require.ensure([], function(require) { Facility = require('./Facility'); }, 'facility');
  </code></pre>
  
  <p><strong>Dev</strong>
  I can see facility.bundle.js in my sources but the call for it returns <em>undefined</em> and this errors</p>
  
  <blockquote>
    <p>Warning: React.createElement: type should not be null, undefined,
    boolean, or number. It should be a string (for DOM elements) or a
    ReactClass (for composite components). Check the render method of
    <code>NonPatientSer</code></p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>Uncaught Invariant Violation: Element type is invalid: expected a
    string (for built-in components) or a class/function (for composite
    components) but got: undefined. Check the render method of
    <code>NonPatientSer</code>.</p>
  </blockquote>
  
  <p><strong>Production</strong> (run build)</p>
  
  <blockquote>
    <p>Not allowed to load local resource:
    file:///C:/Users/.../facility.bundle.js</p>
  </blockquote>
  
  <p><strong>Webpack config</strong></p>
  
  <pre><code>output: {
      path: path.join(__dirname, 'dist'),
      filename: 'bundle.js',
      publicPath:  __dirname + '/',
      chunkFilename: '[name].bundle.js'
    },
  </code></pre>