title: Using Grunt to iterate over templates
body: <p>I'm building a grunt file, and I have 2 folders that need the same grunt tasks applied to them. I would like to be able to use the grunt <code>template</code> property to iterate over each folder so that I don't have to bloat my grunt config object by repeating the configuration objects. Like so: </p>
  
  <pre><code>app1: {
    name: 'app1',
    src: ['src/app/&lt;%= app1.name %&gt;'],
    jsTpl: ['&lt;%= distdir %&gt;/&lt;%= app1.name %&gt;/templates/**/*.js'],
    js: '&lt;%= app1.src %&gt;/**/*.js'
  },
  app2 {
    name: 'app2',
    src: ['src/app/&lt;%= app2.name %&gt;'],
    jsTpl: ['&lt;%= distdir %&gt;/&lt;%= app2.name %&gt;/templates/**/*.js'],
    js: '&lt;%= app2.src %&gt;/**/*.js'
  },
  concat: {
    app1: {
      src: ['&lt;%= app1.src %&gt;'],
      dest: ['dist']
    },
    app2: {
      src: ['&lt;%= app2.src %&gt;'],
      dest: ['dist/&lt;%= app2.name %&gt;']
    }
   }
  </code></pre>
  
  <p>It would be ideal and very DRY to not have to repeat <code>app1</code> and <code>app2</code>—rather, it would be awesome to have them grouped together through some configuration. But I can't seem to figure out how to do it. Thanks for any help!  </p>
  
  <p>Thanks!</p>