C
C
chelnokov_a2021-07-07 11:54:56
JavaScript
chelnokov_a, 2021-07-07 11:54:56

How can I configure gulp to copy only the changed file from the watch list?

Good afternoon.

I am using something like this in my project to copy a filename from one directory to another:

const mover = ({ destPath, globs }) => () => {
    return src(globs)
        .pipe(flatten())
        .pipe(dest(destPath));
};


globs - is a directory that contains many files (conditional **/*.css)

The problem is that when changing one file from the directory, all files in this directory are copied. I would like to avoid this because there are a lot of files.

Any experts out there who can help you figure it out?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Froggyweb, 2021-07-07
@chelnokov_a

try gulp-newer

S
Sergey delphinpro, 2021-07-07
@delphinpro

Two plugins will help you in different situations:
gulp-changed
gulp-changed-in-place

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question