title: Collect multiple RequireJS dependencies
body: <p>There's a set of JS modules representing similar OOP Classes: think of e.g. different types of backend tasks (<code>SendEmailTask</code>, <code>WriteToDbTask</code>, <code>WriteToDiskTask</code>), or different actions on a drawing canvas (<code>DrawArc</code>, <code>DrawLine</code>, <code>DrawBezier</code>). Those are just examples.</p>
  
  <p>Each of those is a single JS file, with its own <code>define</code>, and they're all located in a common directory. In a client module that depends on all of those, the dependency list and argument list have to include each one of those separately, e.g. something like:</p>
  
  <pre class="lang-js prettyprint-override"><code>define([
    'tasks/sendEmailTask', 'tasks/writeToDbTask', 'tasks/writeToDiskTask', ...
    ], function (SendEmailTask, WriteToDbTask, WriteToDiskTask, ...) { 
      /* ... */ 
      /* ... new SendEmailTask(); */ 
      /* ... new WriteToDbTask(); */ 
      /* ... new WriteToDiskTask(); */ 
    });
  </code></pre>
  
  <p>and they both must be updated everytime a new module is added to the set, e.g. <code>MakeCoffeeTask</code>, which seems to me as a BadThing™.</p>
  
  <p>Is there a way to avoid those last issues? I was thinking of a couple of possible ways, but I don't know how to make them work:</p>
  
  <ol>
  <li>Create a kind of <em>namespace</em> module. Each of those sub-modules depends on the namespace one and adds its definition to it. But than if the client too depends only on the namespace, how do you ensure that client gets loaded <em>after</em> all sub-modules?</li>
  <li>Express both dependencies and arguments with some kind of wildcard, like <code>'tasks/*'</code> for dependency and <em>&lt; no idea ></em> for arguments.</li>
  </ol>