gulp.src can't match file like .gitignore or .babelrc

Created on 5 Nov 2016  ยท  2Comments  ยท  Source: gulpjs/gulp

I have met a problem ,when I want to use gulp to move files from one directory to another directory, gulp will miss the file like .gitignore or .babelrc.

โ”œโ”€โ”ฌ source
โ”‚ โ”œโ”€โ”€ hello.txt
โ”‚ โ”œโ”€โ”€ .gitignore
โ”‚ โ”œโ”€โ”€ .babelrc

Here is my code, I put it in a javascript file, and run it with node.
vargulp = require('gulp');
gulp.src('source/**/*').pipe(gulp.dest('./dest'))

after run this file, only hello.txt has been moved normally.
โ”œโ”€โ”ฌ dest
โ”‚ โ”œโ”€โ”€ hello.txt

Most helpful comment

Use {dot: true} in gulp.src to enable finding dotfiles:

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

All 2 comments

Use {dot: true} in gulp.src to enable finding dotfiles:

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

Thanks, @doowb ๐Ÿ˜„

Was this page helpful?
0 / 5 - 0 ratings