title: Loading local jQuery, jQuery UI and other files via RequireJS
body: <p>I started learning javascript/jQuery and wanted to use RequireJS. The following is my file hierarchy:</p>
  
  <pre><code>my_project/
  ├── index.php
  └── scripts/
      ├── require.js
      ├── loader.js
      ├── app/
      │   ├── app.js  // this is where I'd like to write functions for the app
      │   └── helper/ // this folder is empty for now
      └── lib/
          ├── jquery/
          │    └── 1.10.2/
          │        └── jquery.min.js
          └── jqueryui/
              └── 1.10.3/
                  └── jquery-ui.min.js
  </code></pre>
  
  <p>I read through RequireJS docs and StackOverflow posts (<a href="https://stackoverflow.com/questions/12113172/how-do-i-use-jquery-ui-with-requirejs">example</a>) related to this and set up RequireJS configs to be something like this-</p>
  
  <p>In <code>my_project/index.php</code>, I have</p>
  
  <pre><code>&lt;script data-main="scripts/loader.js" src="scripts/require.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In <code>scripts/loader.js</code>, I have</p>
  
  <pre><code>requirejs.config({
      baseUrl: 'scripts/lib',
  
      enforceDefine: true,
  
      paths: {
          "app": '../app', // mapping for my 'scripts/app/' directory
          "jquery": [
              'jquery/1.10.2/jquery.min',
              //'//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min', this works
                  ],
          "jquery-ui": [
              'jqueryui/1.10.3/jquery-ui.min',
              //'//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min', this works
                  ],
  },
  
      shim: {
          "jquery-ui": {
              exports: "$",
              deps: ["jquery"],
          },
      },
  });
  </code></pre>
  
  <p>In <code>scripts/app/app.js</code>, I have</p>
  
  <pre><code>define(['jquery-ui'], function () {
      .... // some js code here
  }
  </code></pre>
  
  <p>Whenever I test the <code>index.php</code>, I see (in Firebug console) <code>Error: No define call for loader</code>, <code>Error: No define call for jquery</code> and <code>Error: Load timeout for modules: jquery-ui</code>. I can eliminate the last two errors by subbing local jQuery and jQueryUI libraries with CDN based one like Google's (shown above as comments).</p>
  
  <p>I would like to know how to load jquery and jqueryUI from local files without getting <code>Error: No define call for jquery</code> and <code>Error: Load timeout for modules: jquery-ui</code>.</p>
  
  <p>I'm sorry if this a long post. As I mentioned above, I am still learning javascript and am trying my best to keep my code clean. If any experienced coder could help me answer any of the above questions, I would really appreciate the help. Thank you.</p>