Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 551 Bytes

split-tasks-across-multiple-files.md

File metadata and controls

28 lines (21 loc) · 551 Bytes

Split tasks across multiple files

If your gulpfile.js is starting to grow too large, you can split the tasks into separate files by using the require-dir module.

Imagine the following file structure:

gulpfile.js
tasks/
├── dev.js
├── release.js
└── test.js

Install the require-dir module:

npm install --save-dev require-dir

Add the following lines to your gulpfile.js file:

var requireDir = require('require-dir');
var tasks = requireDir('./tasks');