title: How to call RequireJS functions in other files? How to separate RequireJS files?
body: <p>Instead of having one giant js file that has a whole bunch of  "defines", how do I call my various "define" functions from other files?</p>
  
  <p>I've been copying these examples, but still cannot get it to work:</p>
  
  <ul>
  <li><a href="https://github.com/requirejs/example-multipage" rel="nofollow">example-multipage</a></li>
  <li><a href="https://github.com/requirejs/example-multipage-shim" rel="nofollow">example-multipage-shim</a></li>
  <li><a href="https://github.com/requirejs/example-jquery-shim" rel="nofollow">example-jquery-shim</a></li>
  </ul>
  
  <p>Here is what I have so far:</p>
  
  <p><strong>main.js</strong></p>
  
  <pre><code>require.config({
      baseUrl: '',
      paths: {
         jquery: '../libraries/jquery-1.10.2.min',
         simControlView: '../javascripts/simControlView'
      }
  });
  
  require(['jquery','loadPage'], function( $,loadPage) 
  { 
          loadPage();
  });
  
  define('loadPage', ['jquery'], function($)
  {
      var simControlView = require(['./simControlView']);
      return function()
      {
           simControlView.showSimControlView(); //having problem here
  
      };
  });
  </code></pre>
  
  <p><strong>simControlView.js</strong></p>
  
  <pre><code>define(['jquery'], function ($) {
      return {
          showSimControlView: function () {
              console.log("Hi!!");
          }
      }
  });
  </code></pre>
  
  <p>Here is the error that I'm getting:</p>
  
  <blockquote>
    <p><strong>Uncaught TypeError</strong>: Object function d(e,c,h){var
    g,k;f.enableBuildCallback&amp;&amp;(c&amp;&amp;H(c))&amp;&amp;(c.__requireJsBuild=!0);if("string"===typeof
    e){if(H(c))return v(A("requireargs", "<strong>Invalid require
    call</strong>"),h);if(a&amp;&amp;s(N,e))return Ne;if(j.get)return
    j.get(i,e,a,d);g=n(e,a,!1,!0);g=g.id;return!s(r,g)?v(A("notloaded",'<strong>Module</strong>
    name "'+g+'" <strong>has not been loaded yet for context</strong>: '+b+(a?"":". <strong>Use
    require([])</strong>"))):r[g]}K();i.nextTick(function(){K();k=q(n(null,a));k.skipMap=f.skipMap;k.init(e,c,h,{enabled:!0});C()});return
    d} <strong>has no method 'showSimControlView'</strong></p>
  </blockquote>
  
  <p>See anything I'm doing wrong? Any help is appreciated! </p>