0.4.2 • Published 8 years ago
gulptask v0.4.2
gulptask
Encapsulating Gulp tasks
Usage
A GulpTask instance is initialized from 6 options:
name(mandatory): A stem from which all task names are formed. 3 tasks are generated automatically:exec:stem,watch:stemandtdd:stem, the latter running firstexec:stembefore starting watching.description(optional): A description for theexec:stemtask.glob(mandatory): Glob for files to be sourced;baseis alwaysprocess.cwd().pipe(optional): Array of initializer plugins with arguments used by underlying PolyPipe.dest(optional): Where to write the transformed files.fn(optional): Overridespipeanddest, providing a custom function for the current task.dependsOn(optional): GulpTask name or array of GulpTask names; Ensures that tasks depended upon are executed first. Note that if dependency tasks havedestdefined, then the dependency is implicitly set anyway.debug(optional): If true, debugging messages are logged onto the screen for every file going through your pipes.
Two options are mandatory: name and glob. But at least one of pipe, dest or fn should be provided for the task to do anything.
Transpiling example
import GulpTask from 'gulptask';
import gulp from 'gulp';
import babel from 'gulp-babel';
new GulpTask({
name: 'transpile:all',
description: 'Transpiling all Js source files',
glob: 'src/**/*.js',
pipe: [babel],
dest: 'build',
});
gulp.task('default', gulp.series('exec:transpile:all'));License
gulptask is MIT licensed.
© 2017 Jason Lenoble