Added a recursive require feature for Gulp that synchronously scans the js/gulp/tasks directory (with the Node.js fs module) and includes *.js files in the build path. This eliminates the need to manually input a new Gulp file in the path when the directory is updated.
function walk(target) {
fs.readdirSync(target).forEach(function(file) {
let trail = target + '/' + file;
let stats = fs.statSync(trail);
if (stats.isDirectory()) walk(trail);
if (stats.isFile() && trail.includes('.js')) {
var split = function(string) {
if (string.includes(__dirname)) {
string = string.replace(__dirname, '.');
string = string.replace('.js', '');
require(string);
}
}(trail);
}
});
}
Added a recursive require feature for Gulp that synchronously scans the
js/gulp/tasks
directory (with the Node.jsfs
module) and includes*.js
files in the build path. This eliminates the need to manually input a new Gulp file in the path when the directory is updated.