gulp-hub
                                
                                 gulp-hub copied to clipboard
                                
                                    gulp-hub copied to clipboard
                            
                            
                            
                        gulp 4.0 - tasks of the same name not called from parent task
When multiple gulpfiles define a task of the same name, those tasks are not all called when another task calls them:
gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var HubRegistry = require('../');
function precompile(cb) {
    gutil.log('precompiling example');
    cb();
};
gulp.task('precompile', precompile);
gulp.task('build', gulp.series('precompile'));
var hub = new HubRegistry(['./project2/gulpfile.js']);
gulp.registry(hub);
project2/gulpfile.js
// this will use a private gulp instance
var gulp = require('gulp');
var gutil = require('gulp-util');
function precompile2(cb) {
    gutil.log('precompiling project2')
    cb();
};
gulp.task('precompile', precompile2);
Running gulp build only runs the precompile task from gulpfile.js and not project2/gulpfile.js. Running gulp precompile runs both tasks as expected.
I would like this functionality so that I can create a main build task that calls a series of sub-tasks that each do a step in the build process. This would then allow the other gulpfile to add their own tasks to be run at precise times during the build process by creating tasks of the same name as the sub-tasks.
For everyone fast fix before this type of patch will be created:
Main gulpfile:
hub(['./skin/frontend/**/gulpfile.js']);
I create skin variable to have name of directory where sub-gulpfile belong.
(Add this in sub-gulpfiles.js)
const SKIN = normalize(__dirname).substr(normalize(__dirname).lastIndexOf('/') + 1);
And this variable is used in dynamically task name:
gulp.task(SKIN + '-' + 'watch:styles', function ()...
So after add prefix, this hub is usefull for multiple type of task
I used this approach in Magento 1.9 where is more than one skin to compile, all done separately or together.