Wondering what would be the best way to accomplish this.
I have multiple themes in my web app, let's say:
/themes/theme_one/
/themes/theme_two/
… etc.
And I don't want to write one big gulp file that handles all of these. Instead I would like to be able to just write gulp theme_one
, and that would run all gulp tasks associated with that theme automatically.
I have realized that what I am really doing is creating a shortcut for gulp --gulpfile themes/theme_one/gulpfile.js
I was thinking a root Gulpfile.js that was something like this:
var gulp = require('gulp');
var themes = ['theme_one', 'theme_two', 'theme_three'];
themes.forEach(function(theme){
gulp.task(theme, function(){
require(__dirname+'/themes/'+theme+'/gulp-tasks.js');
gulp.run('default'); // all theme gulpfiles need a default task
});
});
I see though that gulp.run is deprecated. How should I restructure this to avoid using gulp.run?