title: Minify some files, combine all, with Grunt.JS
body: <p>I'm moving a dev team away from Chirpy, an add-in for visual studio, for combination &amp; minification of CSS/JS files, over to grunt as part of a workflow automation process. </p>
  
  <p>In chirpy, the config looks something like this (truncated for brevity): </p>
  
  <pre><code>&lt;FileGroup Name="scripts.combined.js"  Minify="both"&gt;
      &lt;File Path="forms.js" Minify="false" /&gt;
      &lt;File Path="cookie_monster.js" Minify="true" /&gt;
      ...
  &lt;/FileGroup&gt;
  </code></pre>
  
  <p>So in this abridged case, I have 2 files. One needs to be minified, the other doesn't. (according to the folks here, minifying forms.js breaks functionality, and I haven't been allocated time to fix that yet).</p>
  
  <p>In <code>grunt</code>, I need to run a minification task on <em>some</em> of the files in this list, but not on others. I then need to run a <code>concat</code> task on all files (minified or otherwise). </p>
  
  <p>Given that uglifyJS needs a <code>dest</code> set to output the minified file, do I simply set this to something like <code>temp.min.js</code>, and in my concat task, use this file to build my <code>scripts.combined.js</code> file [comprised of both minified &amp; unminified files], and use grunt clean to remove the <code>temp.min.js</code> file? </p>
  
  <p>Is there a better way to do this? </p>
  
  <p>[EDIT TO ADD]
  I'm also concerned about potential load-order conflicts. The current tool is configured as both "combine all of these files", with a flag on each file indicating whether or not it should be minified. I'm not sure how to replicate this workflow w/ grunt</p>