Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gulp exclude files from a stream if they exist in destination

Tags:

gulp

How would I exclude files from a stream if they exist in a destination. Or, alternatively, how do I tell gulp.dest() not to overwrite files if they exist?

like image 242
Brett Avatar asked Jul 04 '14 06:07

Brett


People also ask

How do I get the filename of a process in Gulp?

We use the through2 library as a wrapper for Node streams and create a log () function which outputs the filename of each processed file to the console. log () is called by Gulp for each file that it processes with three parameters. The first is a File object created by Vinyl and the third is a callback function.

What are streamstreams in Gulp?

Streams in Gulp provide us with a way to convert files into object that can flow through the pipeline without having to be written to disk after each step. The same workflow would look like this in Gulp:

What is the difference between SRC () and DEST () methods in Gulp?

The src () and dest () methods are exposed by gulp to interact with files on your computer. src () is given a glob to read from the file system and produces a Node stream. It locates all matching files and reads them into memory to pass through the stream.

How to see which plugin processes which files in gulpfile?

Now we can use the log plugin in our Gulpfile to display the filename of each processed file alongside a label. We will add the log plugin before every plugin in our workflow to display the plugin name as label. This way we can see which plugin processes which files.


1 Answers

gulp-conflict

Check if files in stream conflict with those in target dir, with option to use new, keep old, show diff, etc.

https://www.npmjs.org/package/gulp-conflict/

like image 176
Delapouite Avatar answered Oct 20 '22 02:10

Delapouite