title: How to bundle circular-dependent modules?
body: <p>For the sake of simplicity, let's say I have two modules: <code>table.js</code> and <code>chart.js</code>. I would like to bundle them using WebPack, but I end up with an error, probably due to the fact that they are dependent on each other.</p>
  
  <p><code>table.js</code>:</p>
  
  <pre><code>var chart = require('./chart');
  module.exports = (function () {
      var init = function() {
          _loadTable();
          chart.init();
      };
  
      var update = function() {
          console.log('table updated');
      };
  
      return {
          init:   init,
          update: update
      }
  })();
  </code></pre>
  
  <p><code>chart.js</code>:</p>
  
  <pre><code>var table = require('./table');
  module.exports = (function () {
      var init = function() {
          _drawChart();
          table.update(); // will throw an error: table.update is not a function
      };
  
      return {
          init: init
      }
  })();
  </code></pre>
  
  <p>What happens here?
  Table is loaded first by <code>table.init()</code> and then loads chart module by <code>chart.init()</code>. Chart is drawed and tries to update the table in return. </p>
  
  <p>However, at this point <code>chart.js</code> doesn't know what is <code>var table = require('./table')</code> (because at that moment <code>var table = {}</code>), thus <code>table.update()</code> will throw an error.</p>
  
  <p>This didn't happen before when modules were managed "traditionally" (loaded by script tags and communicated through global <code>window</code> object).</p>
  
  <p>I am wondering, if WebPack can still be used for parallely-dependent modules like these?</p>