Skip to content

gulp-declare seems to swallow some files? #6

@giladgray

Description

@giladgray

Seeing a very confusing bug in my Handlebars workflow: gulp-declare seems to swallow nearly 50% of the files in the stream. When running the task without gulp-declare, all 387 Handlebars files make it through, but when I add gulp-declare, that number drops to anywhere between roughly 160-200. To make matters worse, it's never the same number in two consecutive runs and it's never the same files--random subset each time.

What's this about?

My Handlebars workflow looks like so:

gulp.src config.src
  .pipe rename(...)
  .pipe handlebars()
    .on 'error', notify.onError()
  .pipe wrap('Handlebars.template(<%= contents %>);')
  .pipe declare({
    root: 'Handlebars.templates'
    processName: (path) ->
      match = /([^\/]+)\/scripts.*\/([^\.]+)/.exec path
      return "[#{match[1]}-#{match[2]}]"
  })
  .pipe count('## templates compiled.', logFiles: true)
  .pipe gulp.dest(config.dest)

Pretty standard stuff, taken straight from gulp-handlebars documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions