Condition to ignore files ".min.js"

1

I have the following task in my gulpfile.js that renames files .js to .min.js :

gulp.task('js', function () {
    return gulp.src(paths.scripts.src)
            .pipe(gulpif(prod, uglify()))
            .pipe(rename({ suffix: '.min' }))
            .pipe(gulp.dest(paths.scripts.dest));
});

However, I need some way to ignore Rename of files that are already ".min.js". Any ideas how to do this?

    
asked by anonymous 12.11.2017 / 23:40

1 answer

0

Replace the code:

return gulp.src(paths.scripts.src)

By code:

return gulp.src([
  '${paths.scripts.src}/*.js',
  '!${paths.scripts.src}/*.min.js'
])
    
13.01.2019 / 03:08