Answer the question
In order to leave comments, you need to log in
Is there a plugin for passing parameters to tasks?
Is there a plugin for passing parameters to tasks in gulp.start?
For example:
gulp.task('projectOne', function(){
gulp.start({
'buildJS': {
path: 'one/js/',
var: 'test'
}
}, 'buildCSS');
});
gulp.task('projectTwo', function(){
gulp.start({
'buildJS': {
path: 'two/js/',
var: 'test'
}
}, 'buildCSS');
});
Answer the question
In order to leave comments, you need to log in
Found a solution
var modules = ['frontend', 'backend'];
var each = require('async-each');
var build = function (module, cb) {
gulp.src('src/' + module + '.js')
.pipe(browserify());
cb();
};
gulp.task('build', function (cb) {
each(modules, build, cb);
});
gulp.task('default', ['build'], function () {
modules.forEach(function (module) {
gulp.watch('src/' + module + '/**', function () {
build(module, function () {});
});
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question