Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy files and folders which start with dot in their name in gulp

I am trying to copy files from one folder to another. My source folder has following structure

+ source
  + file1.txt
  + .bin
    + file2.txt
  + .ignore

Now I have my gulp task as follows

gulp.task("copy", function() {
       gulp.src("./source/**/*", { base: "source" })
           .pipe(gulp.dest("./dest/"));
});

This task skips copying of .bin folder and .ignore file.

How do I update my task to copy the .bin folder and .ignore file as well ?

like image 825
bharathp Avatar asked Sep 06 '25 05:09

bharathp


1 Answers

Can you try with "dot: true"?

gulp.src("./source/**/*", { dot: true, base: "source" })
       .pipe(gulp.dest("./dest/"))

If you want to know more https://github.com/isaacs/minimatch#options

like image 159
Skypper Avatar answered Sep 07 '25 20:09

Skypper