gulp-forkat
v0.0.1
Published
Split the stream, merge the substreams back, cache the state
Downloads
1
Readme
gulp-forkat
Split the stream, merge the substreams back, cache the state
var forkat = require('gulp-forkat');
var filter = forkat();
var lesscss = forkat();
return gulp.src(['jquery.js', '**/*.ctpl'])
.pipe(conkitty({
common: 'common.js',
templates: 'tpl.js',
deps: true
}))
.pipe(filter('**/*.js', function(src) {
return mode === 'prod' ?
src
.pipe(concat('app.js'))
.pipe(uglify({preserveComments: 'some'}))
:
src;
}))
.pipe(filter('**/*.{less,css}', function(src) {
var ret = src
.pipe(lesscss({each: true}, function() {
return src
.pipe(less())
.pipe(prefix('last 1 version', '> 1%'));
}))
.pipe(lesscss.merge());
return mode === 'prod' ?
ret
.pipe(concat('app.css'))
.pipe(minifyCSS())
:
ret;
}))
.pipe(filter(['!**/*.js', '!**/*.css'], function(src) {
return src;
}))
.pipe(filter.merge())
.pipe(gulp.dest('build'));