Gulp - copy and rename a file
I'm extremely new to Gulp. I'm basically trying to watch for a modified JavaScript file, and then make a new copy of it with a new name. (eventually there'll be some processing on it, but Rome wasn't built in a day). My (naive) attempt is this: gulp.task('default', function() { return gulp.watch('../**/**.js', function(obj){ gulp.src(obj.path) .pipe(gulp.dest('foobar.js')); }); }); This takes the modified file and successfully copies it into a folder now called foobar.js. Is there anything simple I can replace gulp.dest('foobar.js') with that will simply copy and rename the src file in place?