Gulp file monitoring problem

  node.js, question

I recently found that gulp-watch is a component that I don’t know where is the problem. It behaves differently on linux and windows. Why do I modify a file on windows10? He will delete the newly modified file first and add it again, while linux will only modify the file. And windows often reports errors, or after running for a while, it becomes monitoring and kaka’s, and it takes half a day to modify a web page. . . My English is not good, so I can’t respond directly to github. . I hope Daniel can talk about it.
My gulp Script

gulp.task('static-sync:dev', ['static-sync'], function () {
 util.log('[Sync] starting file watch');
 return watch(config.static, function (obj) {
 if (obj.event === 'change' || obj.event === 'add')
 return gulp.src(obj.path, {base: './'})
 .pipe(gulp.dest(config.dist))
 .pipe(print(function () {
 Return '[Sync] file sync success:' add obj.path.replace(obj.base,'');
 }));
 else if (obj.event === 'unlink') {
 Vardist filepath = obj.path.replace (_ _ dirname, _ _ dirname plus'/'plus config.dist);
 return gulp.src(distFilePath)
 .pipe(clean())
 .pipe(print(function () {
 Return '[Sync] file remove success:' add obj.path.replace(obj.base,'');
 }));
 bracket
 });
 });

Each modification on windows will enter the deletion and modification of two listening devices, with a total of three events, while linux will enter the deletion and modification of two listening devices once. . . I wonder. .

The problem is that webstorm’s safe reading and writing is a problem. Turn off this safe reading and writing, otherwise compilation is easy to cause problems.

clipboard.png