EDIT: Is there a way to clear this code?
task.coffee
gulp.task 'jade', ->
gulp.src('src/jade/index.jade')
.pipe(jade(pretty: true))
.pipe gulp.dest('dist')
gulp.src('src/jade/views/*.jade')
.pipe(jade(pretty: true))
.pipe gulp.dest('dist/views')
gulp.src('src/jade/views/products/*.jade')
.pipe(jade(pretty: true))
.pipe gulp.dest('dist/views/products')
gulp.watch 'src/jade/*.jade', ['html']
gulp.task 'html', (callback) ->
runSequence 'jade', callback
return
Let's say I run my gulp task to process my .jade files and I am working on an angular application (views / ** / *. Html), how can I clear my task in change my task to do this?
// gulp.src('src/jade/**/*.jade')
// gulp.dest('dist/path/*.html') so for example 'src/jade/index.jade'
// will be output into 'dist/index.html' and
// 'src/jade/views/products/product.jade' will be
// output into 'dist/views/products/product.html'
task.coffee
gulp.task 'jade', ->
gulp.src('src/jade/*.jade')
.pipe(jade(pretty: true))
.pipe gulp.dest('dist')
gulp.watch 'src/jade/*.jade', ['html']
gulp.task 'html', (callback) ->
runSequence 'jade', callback
return
task.js
gulp.task('jade', function() {
return gulp.src('src/jade/*.jade').pipe(jade({
pretty: true
})).pipe(gulp.dest('dist'));
});
gulp.watch('src/jade/*.jade', ['html']);
gulp.task('html', function(callback) {
runSequence('jade', callback);
});
user2537154
source
share