gulp-order icon indicating copy to clipboard operation
gulp-order copied to clipboard

Making it work with gulp-watch

Open newtonianb opened this issue 10 years ago • 2 comments
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))

newtonianb avatar Jul 06 '15 14:07 newtonianb

Does somebody had any luck on this??

tarun29061990 avatar Oct 19 '16 12:10 tarun29061990

I just had to deal with this issue.

  1. using the relative path for so called optional base './' seems required
  2. using the built in gulp.watch beats 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']);
});

Wambosa avatar May 04 '17 03:05 Wambosa