UNPKG

1.94 kBMarkdownView Raw
1gulp-loader
2===========
3
4[![Build Status](https://travis-ci.org/call-a3/gulp-loader.svg?branch=master)](https://travis-ci.org/call-a3/gulp-loader)
5[![Dependency Status](https://david-dm.org/call-a3/gulp-loader.svg)](https://david-dm.org/call-a3/gulp-loader) [![devDependency Status](https://david-dm.org/call-a3/gulp-loader/dev-status.svg)](https://david-dm.org/call-a3/gulp-loader#info=devDependencies)
6
7Gulp plugin that wraps gulp and loads tasks from a specified folder. Task definitions are compatible with [gulp-task-loader](https://www.npmjs.org/package/gulp-task-loader).
8
9## Installation
10
11[![gulp-loader](https://nodei.co/npm/gulp-loader.png?mini=true)](https://nodei.co/npm/gulp-loader)
12
13## Usage
14Just write this in your gulpfile.js
15```javascript
16/*
17 instead of require('gulp') and then defining tasks on it
18 just write the following
19*/
20require('gulp-loader')();
21```
22
23Now create a folder next to your gulpfile.js called `gulp` and have them contain tasks like this:
24```javascript
25/*
26 no need to require('gulp')
27 because gulp is already defined in the scope of the module
28*/
29module.exports = function () {
30 gulp.src('...')
31 // your gulp task here
32 .pipe(gulp.dest('...'));
33}
34
35// the following line is optional
36module.exports.dependencies = ['dep1', 'dep2'];
37```
38(Note: this setup is compatible with [gulp-task-loader](https://www.npmjs.org/package/gulp-task-loader).)
39You can also write tasks in coffeescript.
40
41## Extra features
42gulp-loader wraps the gulp library in a backwards-compatible way and exposes it to the tasks.
43This means you can define your tasks as if gulp was pre-loaded, but you can also use some shortcuts or extra features.
44
45### gulp.util
46This exposes the gulp-util library. In other words, you can use `gulp.util` instead of
47```
48var gutil = require('gulp-util');
49gutil.log(); // or whatever gulp-util function you would use
50```
51
52## License
53[MIT](http://github.com/call-a3/gulp-loader/blob/master/LICENSE)