gulp-order
gulp-order copied to clipboard
Making it work with gulp-watch
trafficstars
Is this known to break with gulp-watch? It seems my changed file is not being picked up when I have the gulp-order hooked up. I'm also using it with gulp-cache and gulp-remember.
return gulp.src(conf.src)
.pipe(coffeeFilter)
.pipe($.cached('coffee'))
.pipe($.coffee())
.pipe($.remember('coffee'))
.pipe(coffeeFilter.restore())
.pipe($.order(castExtension(conf.src, ['coffee'], 'js'), { base: process.cwd() }))
.pipe($.concat(conf.outputName))
.pipe(gulp.dest(conf.dest))
Does somebody had any luck on this??
I just had to deal with this issue.
- using the relative path for so called optional base './' seems required
- using the built in
gulp.watchbeats out the gulp-watch plugin (more stable)
gulp.task('example', function() {
return gulp.src(['lib/*', 'spec/*spec.js'])
.pipe(order(['lib/dep.js', 'spec/*.js'], { base: './' }))
.pipe(concat('combinedAndOrdered.js'))
.pipe(gulp.dest('./.temp/'));
});
gulp.task('watch', function() {
gulp.watch(['spec/*.js'], ['example']);
});