title: merge javascript files in directory with node uglify + watch?
body: <h2>Goal:</h2>
  
  <p><em>I am trying to build an effortless workflow for client side templating development.</em></p>
  
  <h2>Doc Root:</h2>
  
  <pre><code>/views/uncompiled/
  /static/js/compiled/
  </code></pre>
  
  <p>We start in <code>/views/uncompiled/</code></p>
  
  <p>This is where I can build stuff out, like <code>/views/uncompiled/index.html</code> for example.</p>
  
  <p>Im building <strong><a href="http://linkedin.github.com/dustjs/" rel="nofollow">dust.js</a></strong> templates, so I am using <strong><a href="https://github.com/dmix/dusterjs" rel="nofollow">dusterjs</a></strong> too listen for changes in my <code>/views/uncompiled/</code> directory, and automatically render compiled <code>*.js</code> counterparts in my <code>/static/js/compiled/</code> directory.</p>
  
  <p>So <code>/views/uncompiled/index.html</code> renders out <code>/static/js/compiled/index.js</code> anytime a change is saved. </p>
  
  <h2>Problem:</h2>
  
  <p>My <code>layout.html</code> is growing bigger. I need to include a new <code>*.js</code> script everytime I add another template:</p>
  
  <pre><code>&lt;head&gt;
      &lt;script src='/static/js/compiled/index.js'&gt;&lt;/script&gt;
      &lt;script src='/static/js/compiled/header.js'&gt;&lt;/script&gt;
      &lt;script src='/static/js/compiled/footer.js'&gt;&lt;/script&gt;
      &lt;script src='/static/js/compiled/baconstrips.js'&gt;&lt;/script&gt;
      ...
  &lt;/head&gt;
  </code></pre>
  
  <h2>Solution:</h2>
  
  <p>Use another watch on the <code>/static/js/compiled/</code> folder too automatically concat <code>*.js</code> into a single <code>app.js</code> that will always be included in my <code>&lt;head&gt;</code> anytime the contents of that folder changes:</p>
  
  <pre><code>&lt;head&gt;
      &lt;script src='/static/js/app.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  </code></pre>
  
  <h2>Question:</h2>
  
  <p>I would like to use a concatonation tool like <strong><a href="https://github.com/mishoo/UglifyJS" rel="nofollow">Uglify.js</a></strong> that also does compression. </p>
  
  <ul>
  <li>Are there any node packages that automate the solution above? </li>
  <li>Is there a native function of <strong><a href="https://github.com/mishoo/UglifyJS" rel="nofollow">Uglify.js</a></strong> that already does this?</li>
  </ul>