title: Load files in specific order with RequireJs
body: <p>I'm new to RequireJS and I'm stuck with the loading order.</p>
  <p>I have a global project configuration that I need to be loaded before the modules located in js/app/*.</p>
  <p>Here's my struture :</p>
  <pre><code>index.html
  config.js
  js/
      require.js
      app/
          login.js
      lib/
          bootstrap-2.0.4.min.js
  </code></pre>
  <p>Here's the config.js file :</p>
  <pre><code>var Project = {
      'server': {
          'host': '127.0.0.1',
          'port': 8080
      },
      'history': 10,      // Number of query kept in the local storage history
      'lang': 'en',       // For future use
  };
  </code></pre>
  <p>And here's my requirejs file (app.js) :</p>
  <pre><code>requirejs.config({
      //By default load any module IDs from js/lib
      baseUrl: 'js/lib',
      //except, if the module ID starts with &quot;app&quot;,
      //load it from the js/app directory. paths
      //config is relative to the baseUrl, and
      //never includes a &quot;.js&quot; extension since
      //the paths config could be for a directory.
      paths: {
          bootstrap: '../lib/bootstrap-2.0.4.min',
          app: '../app',
      },
      shim: {
          'app': {
              deps: ['../../config'],
              exports: function (a) {
                  console.log ('loaded!');
                  console.log (a);
              }
          } // Skual Config
      },
  });
  
  var modules = [];
  modules.push('jquery');
  modules.push('bootstrap');
  modules.push('app/login');
  
  
  // Start the main app logic.
  requirejs(modules, function ($) {});
  </code></pre>
  <p>But sometimes, when I load the page, I have a &quot;Project&quot; is undefined, because login.js has been loaded BEFORE config.js.</p>
  <p>How can I force config.js to be loaded at first, no matter what ?</p>
  <p>Note: I saw order.js as a plugin for RequireJS but it's apparently not supported since the v2, replaced by <code>shim</code>.</p>