Created
December 22, 2020 16:29
-
-
Save cyberdev/23e2b7a9312d22a964ffb48ff5b7aa3d to your computer and use it in GitHub Desktop.
Gulp file for spliting tast on gulp directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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