gulp-lazy-task - lazy gulp task loader
- place your tasks in external files
- write in gulpfile just paths and configurations
- you task will be required only when task will be started
- load gulp plugins in you task just by getter:
this.util
orthis.sourceMaps
no more require. - automatic add gulp-plumber in pipe (error no more crash node)
Usage in gulpfile.js
var task = './tasks';
in file './tasks/' + taskName + '.js'
module { options // {param: 11} thisgulp // gulp thisutil // gulp-util plugin this // gulp-load-plugins // his read you package.json file and create getters on "this" // you no longer need to call require() // to load gulp plugin like "gulp-source-maps" just white this.sourceMaps // and anjoy =)}
example:
in gulpfile.js :
var task = './tasks';
in './tasks/babel.js' :
module { return thisgulp }
in package.json :
P.S. to support coffee-script tasks just use or gulpfile.coffee, or in head of gulpfile.js write
require('coffee-script/register')
enjoy ;)