cognitom / symbols-for-sketch

Symbol font templates for Sketch.app
680 stars 76 forks source link

We need `gulp watch` #1

Closed cognitom closed 9 years ago

cognitom commented 10 years ago

Hi, everyone! I need your help to improve this template.

Sketch.app saves the file automatically in the background. With usual way of gulp, too much save events will be emitted. Does anyone have a good way to catch just the save events by the user?

For example, the code below doesn't work well. Umm..

gulp.task('watch', function() {
  gulp.watch('symbol-font-14px.sketch', ['symbols']);
});
cognitom commented 9 years ago

The code has been changed like below. Use debounceDelay. Not perfect, but it just works.

gulp.task('watch', function(){
  gulp.watch('*.sketch/Data', { debounceDelay: 3000 }, ['symbols']); // wait 3 sec after the last run
});