title: Dynamic file mapping with relative destination
body: <p>This is a generic question about dynamic file mapping with <em>Grunt.js</em>, but for the example purpose, I'll be trying to build <strong>coffee</strong> files in a project with a dynamic structure :</p>
  
  <p><img src="https://i.stack.imgur.com/RlPFU.png" alt="Structure"></p>
  
  <p>Here, I can have multiple (dynamic) target folders with a different depth. Finding <em>coffee</em> files remain easy, it will match <code>**/coffee/*.coffee</code> anytime.</p>
  
  <p>What I'm trying to achieve, is making the <strong><em>dest</em></strong> property <strong>relative</strong> to the matched coffee file :</p>
  
  <ul>
  <li>find <strong><code>**/coffee/*.coffee</code></strong></li>
  <li>compile to <strong><code>../js/*.js</code></strong></li>
  </ul>
  
  <p>Instead of making it relative to the project folder (Gruntfile).</p>
  
  <pre class="lang-js prettyprint-override"><code>coffee: {
      compile: {
          files: [
              {
                expand: true,
                src: ['**/coffee/*.coffee'],
                dest: '../js/', // This won't work ! But I wish it could :)
                ext: '.js'
              }
          ]
      }
  }
  </code></pre>
  
  <p>How would you achieve this ?</p>