gulp-declare
gulp-declare copied to clipboard
gulp-declare seems to swallow some files?
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.
Whoa. This is odd... If you drop your processName method, does it still mess things up?
Yep, still messes things up without processName :(
I'm running into the exact same problem. It's a little more consistent for me, around 99-102 files out of 357 make it through.
Any updates?
Actually, bumping back to 0.2.0 of gulp-declare fixed it for me.
I have the same problem, it is very troublesome and hard to find. The solution with version 0.2.0 solved the issue for me.
This is definitely a weird issue. Can someone create a repository that reproduces the issue so I can investigate? Between 0.2.0 and 0.3.0, the only thing that really changed was upgrading dependencies, so perhaps there's and issue upstream.