Edit documentation to register tasks to gulp alongside taker.
See original GitHub issueOn the “Sharing Functionalities” section of the documentation, it goes through an example on how to collaborate tasks into the main file for usage in default.
Most people will want to be able to run individual gulp tasks from the command line. Since gulp-hub is not up to date with the latest undertaker functionality, we now have to register undertaker tasks instead of gulp tasks to properly share them through the registry.
I’ve found that by editing the example set function to register the gulp task, it saves a lot of headache and lines of code to register the gulp task at the same time we are setting the taker task (obviously requiring the gulp module in order to do so).
What I did was this:
ConfigRegistry.prototype.set = function set(name, fn) {
var task = this._tasks[name] = fn.bind();
gulp.task(name, fn);
return task;
};
We run CI that use SSH commands for gulp (i.e. gulp test, gulp deploy:rebuild, etc.)
Am I doing something wrong, leading me to have to insert this code? Or is this future functionality that is not completed yet?
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
You don’t want to create an undertaker instance in this file, you want to use the
.registry()
API available on gulp in your gulpfile. Also, registry’s are made to share a bunch of common tasks, not 1 per registry, so I am guessing this is going to have really bad startup performance. gulp-hub has a branch where they support the new API. The custom registry API is an advanced feature and I think you are using it where you probably shouldn’t be.You are correct, the startup performance is horrible sometimes 👍 Usually on the first run it takes awhile to load all of the JS files. I picked this up from one of my co-workers that left the company and was wondering why that was happening.
I tried the new gulp-hub branch and failed to get it working, but with the new information you’ve just given me, I think I might be able to get it work.
Thanks again for all of the help!