title: Is it possible to set dependencies for a folder using require.js?
body: <p>Is it possible to set dependencies for an entire folder using <code>require.js</code>?</p>
  
  <p>I know that you can use the shim configuration to set dependencies for a file:</p>
  
  <pre><code>require.config({
      shim: {
          'plugin/backbone/xyz': {
              deps: ['lib/backbone'],
              exports: 'Backbone'
          }
      }
  });
  </code></pre>
  
  <p>In the above example I define the dependencies for the plugin backbone/xyz, but I would like to define the dependencies for all backbone plugins:</p>
  
  <pre><code>require.config({
      shim: {
          'plugin/backbone/': { // I would like to specify a folder here but it doesn't work.
              deps: ['lib/backbone'],
              exports: 'Backbone'
          }
      }
  });
  </code></pre>
  
  <hr>
  
  <p>I think that I once found a gist about it on GitHub, but I can't seem to find it again.</p>
  
  <hr>
  
  <p><strong>To clarify:</strong> This isn't about requiring an entire folder, but setting dependencies for it - What all files in the folder needs before they are ready to initialize, each and one of them. It would be accomplished by adding shims for all the files, but I would like to only have to add that shim once for the entire folder:</p>
  
  <pre><code>shim: {
      'lib/backbone': {
          exports: 'Backbone' // &lt;- No use of .noConflict() so all plugins can be required and export Backbone as well.
      },
      'plugin/backbone/a': {
          deps: ['lib/backbone'], // &lt;- Require backbone
          exports: 'Backbone' // &lt;- Export backbone
      },
      // Same requirement and folder for these files:
      'plugin/backbone/b': {
          deps: ['lib/backbone'],
          exports: 'Backbone'
      },
      'plugin/backbone/c': {
          deps: ['lib/backbone'],
          exports: 'Backbone'
      }
  }
  </code></pre>