Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch is detecting the same file twice on minimal example #243

Open
dman777 opened this issue Jul 20, 2017 · 0 comments
Open

Watch is detecting the same file twice on minimal example #243

dman777 opened this issue Jul 20, 2017 · 0 comments

Comments

@dman777
Copy link

dman777 commented Jul 20, 2017

Using Windows 7:

$ gulp --version
[14:00:20] CLI version 3.9.1
[14:00:20] Local version 3.9.1

gulp.watch is catching the same file change twice. I used to separate editors(vi and notepad) to make sure it was not the editor saving the file twice. I also tried debounceDelay and interval with on success to rid the the problem:

$ gulp watch
[13:57:27] Using gulpfile C:\git\global-spredfast-world-wall\gulpfile.js
[13:57:27] Starting 'watch'...
[13:57:27] Finished 'watch' after 8.44 ms
{ type: 'changed',
  path: 'C:\\git\\global-spredfast-world-wall\\index.html' }
{ type: 'changed',
  path: 'C:\\git\\global-spredfast-world-wall\\index.html' }
const gulp = require('gulp');
var browserSync = require('browser-sync').create();


gulp.task('serve', ['watch', 'browserSync']);
gulp.task('watch', watch);

function reloadBrowserSync(done) {
  console.log(done)
  browserSync.reload();
}

gulp.task('browserSync', function() {
    browserSync.init({
        server: {
            baseDir: "./"
        }
    });
});

function watch() {
  gulp.watch([
    'index.html'
  ], function(event){ console.log(event)});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant