title: How requirejs load commonjs packages?
body: <p>I follow <a href="http://requirejs.org/docs/api.html#packages" rel="nofollow">http://requirejs.org/docs/api.html#packages</a> to learn how RequireJs load CommonJS modules, but I can't get it.</p>
  
  <p>I have below file.</p>
  
  <p>foo/foo.js
  main.js
  require.js</p>
  
  <p>foo/foo.js with content:</p>
  
  <pre><code>exports.bar = '1234';
  exports.xyz = function noop() {};
  </code></pre>
  
  <p>main.js:</p>
  
  <pre><code>requirejs.config({
      packages: [{name:'foo', main: 'foo'}]
  });
  
  require(['foo'], function(foo) {
     console.log(foo.bar);
  });
  </code></pre>
  
  <p>It said can't read bar of undefined</p>