0

I have this Gulp task:

gulp.task('haml', function(){
  log('Compiling Haml to Html!');

  var hamlConfig = [
    './src/views/products/bancos/*.haml',
    './src/views/products/oferta/*.haml'
  ]

  return gulp
    .src(hamlConfig)
    .pipe($.rubyHaml())
    .pipe(gulp.dest('./dist/'))
  );
});

Issue:

When I do gulp haml in my terminal, it compiles haml files into html and export them into the dist folder.

Approach

What I'm trying to approach is when I use my task I want to export all these files in their respective folders:

example:

./src/views/products/bancos/*.haml into ./dist/bancos/*.html

and

./src/views/products/oferta/*.haml into ./dist/oferta/*.html

I tryed passing and array in dest function but it didn't work that easy.

Alex
  • 879
  • 2
  • 10
  • 20
  • Fwiw, unless there's some specific reason to not do this, you can tighten up your code by removing the `var hamlConfig` part and just saying `.src(['./src/views/products/bancos/*.haml', './src/views/products/oferta/*.haml'])` (or maybe even just `.src('./src/view/products/**/*.haml')` depending on your project) – henry Sep 06 '16 at 18:16
  • 1
    Wow, you were right, I was looking for a similar question for over 30 minutes with no results, thanks, this solved my issue. Thanks!. – Alex Sep 06 '16 at 18:26

0 Answers0