title: How do I gulp.src an entire folder and its subfolders, and then gulp.dest based on files' location?
body: <p><strong>EDIT:</strong> is there a way to clean up this code?</p>
  
  <p>task.coffee</p>
  
  <pre><code># Watch pages
  gulp.task 'jade', -&gt;
    # Watch index
    gulp.src('src/jade/index.jade')
    .pipe(jade(pretty: true))
    .pipe gulp.dest('dist')
    # Watch views
    gulp.src('src/jade/views/*.jade')
    .pipe(jade(pretty: true))
    .pipe gulp.dest('dist/views')
    # Watch views/products
    gulp.src('src/jade/views/products/*.jade')
    .pipe(jade(pretty: true))
    .pipe gulp.dest('dist/views/products')
  
  gulp.watch 'src/jade/*.jade', ['html']
  gulp.task 'html', (callback) -&gt;
    runSequence 'jade', callback
    return
  </code></pre>
  
  <hr>
  
  <p>Let's say I'm running my gulp task to process my .jade files and I'm working on an angular app (views/**/*.html), how do I keep clean my task in order to change my task to do this?</p>
  
  <pre><code>// gulp.src('src/jade/**/*.jade')
  // gulp.dest('dist/path/*.html') so for example 'src/jade/index.jade'
  // will be output into 'dist/index.html' and
  // 'src/jade/views/products/product.jade' will be
  // output into 'dist/views/products/product.html'
  </code></pre>
  
  <p>task.coffee</p>
  
  <pre><code># Watch pages
  gulp.task 'jade', -&gt;
    gulp.src('src/jade/*.jade')
    .pipe(jade(pretty: true))
    .pipe gulp.dest('dist')
  gulp.watch 'src/jade/*.jade', ['html']
  gulp.task 'html', (callback) -&gt;
    runSequence 'jade', callback
    return
  </code></pre>
  
  <p>task.js</p>
  
  <pre><code>gulp.task('jade', function() {
    return gulp.src('src/jade/*.jade').pipe(jade({
      pretty: true
    })).pipe(gulp.dest('dist'));
  });
  
  gulp.watch('src/jade/*.jade', ['html']);
  
  gulp.task('html', function(callback) {
    runSequence('jade', callback);
  });
  </code></pre>