Skip to content

Instantly share code, notes, and snippets.

@ciases
Last active March 1, 2017 15:39
Show Gist options
  • Save ciases/d54fe9ddc1a54d36433989fbacf83ee5 to your computer and use it in GitHub Desktop.
Save ciases/d54fe9ddc1a54d36433989fbacf83ee5 to your computer and use it in GitHub Desktop.
[gulp] Watch new files

How to watch new files in gulp

Add an extra argument {cwd:'./'} in gulp.watch:

// gulpfile.js
gulp.watch('src/js/**/*.js', {cwd:'./'}, ['scripts']);

Note!

  • Avoid ./ in the file/folder patterns
  • Ensure ./ in the value for cwd

Credits: stackoverflow.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment