Answer the question
In order to leave comments, you need to log in
How to limit file selection in gulp?
Good evening!
There is a directory with N directories in one of the directories (folder_js, for example) there are files file1.js, file2.js..., file1.min.js, file2.min.js...
I need to copy the contents of the entire directory to another except , not minified folder_js directory files,
I do like this :
gulp.src([
"/**/*",
"!/**/folder_js/*.js",
"/**/folder_js/*.min.js"
])
Answer the question
In order to leave comments, you need to log in
The problem with the array is src
that gulp iterates over each key in sequence.
I could filter
n't do it without
const gulp = require('gulp');
const filter = require('gulp-filter');
return gulp.src('src/**/*')
.pipe(filter(
['**/*', '!src/folder_js/*.js', 'src/folder_js/*.min.js']
))
.pipe(gulp.dest('www'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question