title: RequireJS multiple module in single file
body: <p>I want to merge multiple modules into a single file, but I can't find an official document about how to do it. Now I'm using the below method, it works, but I'm wondering about the following:</p>
  
  <ul>
  <li>Is it technically correct?</li>
  <li>How does RequireJS check whether a module is loaded or not? By using the module name or the file name?</li>
  <li>Will this solution init modules multiple times in some situation?</li>
  </ul>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>&lt;script src="require.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  requirejs.config({
      paths: {
          'a': 'test',
          'b': 'test'
      }
  });
  
  require(['a', 'b'], function () {
      console.log('a &amp; b loaded');
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>test.js</strong></p>
  
  <pre><code>console.log('loading test.js');
  // I have some init here, like "Avoid `console` errors in IE"
  
  define('a', function () {
      console.log('a module');
  });
  
  define('b', function () {
      console.log('b module');
  });
  </code></pre>