0.1.7 • Published 8 years ago

gulp-load-dir v0.1.7

Weekly downloads
1
License
ISC
Repository
github
Last release
8 years ago

gulp-load-dir

Loads in gulp task scripts in a designated directory.

Install

$ npm install --save-dev gulp-load-dir

Usage

When writing a gulpfile, instead of putting all gulp task logic in one file, you can just write a single line like this:

require('gulp-load-dir')();

Then you can seperate your tasks into files and put them in 'gulp/tasks' directory(default path for task scripts);

You can also pass in options, and designate the tasks directory if you will

require('gulp-load-dir')({
  taskDir: require('path').join(__dirname, 'gulp-tasks'),
  pkg: require('./package.json'),
  cfg: require('./config.json')
});

And in your task script file,

module.exports = function task(gulp, $, opts){
  gulp.task('jshint', function(){
    return gulp.src(opts.cfg.src).pipe($.jshint({defaultFile:'jshint.rc'}))
      .pipe($.jshint.reporter('jshint-stylish'));
  });
}

This module uses 'gulp-load-plugins' to load gulp plugins, and attaches them to the '$' argument;

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago