title: RequireJS paths config
body: <p>My development config (in "index.html" file) for RequireJS is:</p>
  
  <pre><code>&lt;script src="require-2.1.5.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      require.config({
          baseUrl: 'js',
          paths: {
              angular: 'libraries/angular-1.1.5.min',
              jquery: 'libraries/jquery-2.0.0.min',
              underscore: 'libraries/underscore-1.4.4.min',
              ...
              zeroclipboard: 'plugins/zeroclipboard-1.0.7.min',
              tablesorter: 'plugins/jquery.tablesorter-2.9.1.min',
              ...
          },
          shim: {
              'angular': {
                  exports: 'angular'
              },
              'underscore': {
                  exports: '_'
              }
          },
          packages: [
              {
                  name: 'index',
                  location: 'app/index',
                  main: 'main'
              }
          ]
      });
  
      require(['index']);
  &lt;/script&gt;
  </code></pre>
  
  <p>But on production I have only 2 concatenated files for libraries and plugins:</p>
  
  <pre><code>js/libraries.js // all jQuery, AngularJS, RequireJS, Underscore and other libraries concatenated
  js/plugins.js // all plugins (already an AMD modules, no need for "shim" config) concatenated
  </code></pre>
  
  <p>So, how do I write my config "paths" now? I don't have any <em>'libraries/angular-1.1.5.min.js'</em> and other paths.</p>
  
  <p>My solution is to write:</p>
  
  <pre><code>    paths: {
          angular: 'libraries',
          underscore: 'libraries'
      }
  </code></pre>
  
  <p>I associate AngularJS and Underscore to <em>'libraries.js'</em> file and everything works perfect. (No need for jQuery and all plugins — they are already an AMD modules).</p>
  
  <p>But is that a right way to write paths? My solution seems to me kinda dirty workaround, not the best practices solution.</p>
  
  <p>My r.js build process:</p>
  
  <pre><code>({
  baseUrl: 'scripts',
  paths: {
      jquery: 'jquery-2.0.0.min',
      ...
      tablesorter: 'jquery.tablesorter-2.0.5.min',
      zeroclipboard: 'zeroclipboard-1.0.7.min'
  },
  name: 'foo/main',
  exclude: [
      'angular',
      'jquery',
      ...
      'tablesorter',
      'zeroclipboard'
  ],
  optimize: 'uglify',
  out: 'production/js/foo.js'
  })
  </code></pre>
  
  <p><strong>UPD 1:</strong></p>
  
  <p>What I want:</p>
  
  <pre><code>www.mysite.com/about.html:
  
  &lt;script src="js/libraries.js"&gt;&lt;/script&gt;&lt;-- jQuery (already AMD), AngularJS (not AMD), RequireJS, Underscore (not AMD) and other libraries already here, only 1 http request needed //--&gt;
  &lt;script src="js/plugins.js"&gt;&lt;/script&gt;&lt;-- all AMD //--&gt;
  &lt;script&gt;
      require.config({
          baseUrl: 'js',
          paths: {
              angular: WHAT I NEED TO WRITE HERE?,
              underscore: WHAT I NEED TO WRITE HERE?
          },
          shim: {
              'angular': {
                  exports: 'angular'
              },
              'underscore': {
                  exports: '_'
              }
          },
          packages: [
              {
                  name: 'about',
                  location: 'js',
                  main: 'about'
              }
          ]
      });
  
      require(['about']); // will load "js/about.js"
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>UPD 2:</strong></p>
  
  <p>Ok, it is clear about "priority", so, I don't need for first and second «script» tags (but I need to separate "Require.js" from "libraries.js") — RequireJS will load them automatically. But what should be done with non-AMD libraries in "libraries.js" file?</p>
  
  <p>AngularJS and UnderscoreJS are non-AMD modules, that is why I have to use "shim", right? But to make "shim" work, I need to use "paths" also, so "shim" can locate shimmed modules, right? But I still have only 1 file — "libraries.js" and I cannot write it in "path" option… Just really stuck…</p>