1

In gulp I have no problem matching ZERO or more directories with the **/*.file_ext method. What I'm wanting to do is only match files WITHIN a nested directory. I'm trying to set this up because I need to ensure that when gulp builds a concatenated .js file that it includes everything in the nested directories FIRST, but I have a LOT of gulp tasks that are generated dynamically so the name of the nested directory isn't something that I want to specify in the task.

So in a task like...

let gulp = require('gulp'),
    uglify = require('gulp-uglify'),
    concat = require('gulp-concat'),
    rename = require('gulp-rename'),
    watch = require('gulp-watch'),
    batch = require('gulp-batch'),
    order = require('gulp-order');

gulp.task('build:default:my_overview', function () {
    return gulp.src(PATHS.prefix + 'default/my_overview' + PATHS.suffix)
        .pipe(order([
            PATHS.prefix + 'default/my_overview/**/*.js',
            PATHS.prefix + 'default/my_overview/*.js'
        ]))
        .pipe(concat('my_overview' + '.js'))
        .pipe(gulp.dest(PATHS.prefix + 'default/my_overview' + '/dist-js'))
        .pipe(uglify())
        .pipe(rename({ extname: '.min.js' }))
        .pipe(gulp.dest(PATHS.prefix + 'default/my_overview' + '/dist-js'));
});

I want to be able to take the PATHS.prefix + 'default/my_overview/**/*.js', line and have the /**/ exclude the current directory. Is this possible?

Jared
  • 5,840
  • 5
  • 49
  • 83

1 Answers1

2

I haven't tried this but how about my_overview/*/**/*.file_ext?

Aaronius
  • 4,936
  • 6
  • 31
  • 40