Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp Copying Files from one Directory to another

Tags:

gulp

bower

I want to Gulp Copy Multiple Files

gulp.task('copy', function(){

     gulp.src(
        'bower_components/bootstrap/dist/js/bootstrap.js', 
        'bower_components/jquery/dist/jquery.min.js', 
        'bower_components/jquery.stellar/src/jquery.stellar.js',
        'bower_components/jquery-waypoints/waypoints.js',
        'bower_components/jquery-easing-original/jquery.easing.1.3.js')
    .pipe(gulp.dest('public/assets/js'));
});

To copy my files from my bower_components directory to my assets directory, but it is only working with the first line (bootstrap.js), all others are ignored.

I wouldn't like to pipe every single file to the destination directory.

How would I go about to do this?

regards,

George

P.S. I am using it just for devel. In production I would concatenate and minify them before I deploy them. Nonetheless I believe that the task is clear, I want the bower_components to show up my public folder. I think that it is a little bit tedious to have all the files on the bower_components folder, only to copy them into your public directory. Is there any other best practice to use the bower component files?

like image 738
LoveAndHappiness Avatar asked Jun 22 '14 21:06

LoveAndHappiness


1 Answers

Try to add [], like this:

gulp.src([
    'file1',
    'file2',
    'file3'
])
.pipe(gulp.dest('public/assets/js'));
like image 177
Levan Lotuashvili Avatar answered Oct 28 '22 12:10

Levan Lotuashvili