Answer the question
In order to leave comments, you need to log in
How to use slashes in regex in Gulp?
Hello.
I have two files, relative to the root of the project, which contains gulpfile.js, they have the following paths:
src/index.html
and
src/page1/page1.html
I do this:
Next, the pipes must process these two files and place them modified versions to the /build directory. The problem is that only index.html is processed and page1.html is not affected.
If the following string is passed to .src():
then none of these files are processed. So the problem is in the slashes inside the +().
Please tell me how to write paths containing a slash in +()
I didn't find anything about it on glob's github. https://github.com/isaacs/node-glob
gulp.src("src/+(index.html|page1/page1.html)");
"+(src/index.html|src/page1/page1.html)"
Answer the question
In order to leave comments, you need to log in
Why do that when you can just
gulp.src('src/**/*.html')
.pipe(gulp.dest('build/'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question