Skip to content

Instantly share code, notes, and snippets.

@cyberdev
Created December 22, 2020 16:29
Show Gist options
  • Save cyberdev/23e2b7a9312d22a964ffb48ff5b7aa3d to your computer and use it in GitHub Desktop.
Save cyberdev/23e2b7a9312d22a964ffb48ff5b7aa3d to your computer and use it in GitHub Desktop.
Gulp file for spliting tast on gulp directory
const gulp = require('gulp');
const requireDir = require('require-dir');
// load tasks
requireDir('./gulp', {
recurse: true,
mapValue: function(value) {
if (typeof value === 'object') {
const keys = Object.keys(value);
return keys.map(taskName => {
return gulp.task(taskName, value[taskName])
});
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment