gulp-hub

A gulp plugin to run tasks from multiple gulpfiles

27 个版本
安装
npm install gulp-hub
yarn add gulp-hub
pnpm add gulp-hub
bun add gulp-hub
README

gulp-hub

Gulp extension to run tasks from multiple gulpfiles.

build status

Basic Usage:

  1. Install gulp-hub:

    $ npm install gulp-hub
    
  2. Create a gulpfile.js which looks like this:

    var gulp = require('gulp');
    var HubRegistry = require('gulp-hub');
    
    /* load some gulpfiles into the registry */
    var hub = new HubRegistry(['./project1/gulpfile.js', './project1/gulpfile.js']);
    
    /* tell gulp to use the tasks just loaded */
    gulp.registry(hub);
    
  3. Run gulp [taskname]

Gulp will execute [taskname] in all of the gulpfiles.

More Details:

HubRegistry constructor accepts glob patterns. Tasks registered in the same gulpfile from which gulp-hub is called will be included. If one of the child gulpfiles also uses HubRegistry then that is handled too.

Use gulp --tasks to view the task tree:

gulp --tasks

gulp-hub/examples$ gulp --tasks
[15:56:21] Loading /Users/frank/work/gulp-hub/examples/project1/gulpfile.js
[15:56:21] Loading /Users/frank/work/gulp-hub/examples/project1/project1A/gulpfile.js
[15:56:21] Loading /Users/frank/work/gulp-hub/examples/project1/project1B/gulpfile.js
[15:56:21] Loading /Users/frank/work/gulp-hub/examples/project2/gulpfile.js
[15:56:21] Tasks for ~/work/gulp-hub/examples/gulpfile.js
[15:56:21] ├─┬ build
[15:56:21] │ └─┬ <series>
[15:56:21] │   ├─┬ /Users/frank/work/gulp-hub/examples/project1/gulpfile.js-build
[15:56:21] │   │ └─┬ build
[15:56:21] │   │   └─┬ <series>
[15:56:21] │   │     ├─┬ /Users/frank/work/gulp-hub/examples/project1/project1A/gulpfile.js-build
[15:56:21] │   │     │ └─┬ build
[15:56:21] │   │     │   └─┬ <series>
[15:56:21] │   │     │     ├── precompile
[15:56:21] │   │     │     └── compile1A
[15:56:21] │   │     ├─┬ /Users/frank/work/gulp-hub/examples/project1/project1B/gulpfile.js-build
[15:56:21] │   │     │ └─┬ build
[15:56:21] │   │     │   └─┬ <series>
[15:56:21] │   │     │     ├── precompile
[15:56:21] │   │     │     └── compile
[15:56:21] │   │     └─┬ /Users/frank/work/gulp-hub/examples/project1/gulpfile.js-internal-build
[15:56:21] │   │       └─┬ build
[15:56:21] │   │         └─┬ <series>
[15:56:21] │   │           ├── precompile
[15:56:21] │   │           └── compile
[15:56:21] │   ├─┬ /Users/frank/work/gulp-hub/examples/project2/gulpfile.js-build
[15:56:21] │   │ └─┬ build
[15:56:21] │   │   └─┬ <series>
[15:56:21] │   │     ├── precompile
[15:56:21] │   │     └── compile
[15:56:21] │   └─┬ /Users/frank/work/gulp-hub/examples/gulpfile.js-internal-build
[15:56:21] │     └─┬ build
[15:56:21] │       └─┬ <series>
[15:56:21] │         ├── precompile
[15:56:21] │         └── compile

See the example project for more advanced examples.

版本列表
4.2.0 2017-12-31
4.1.0 2017-02-26
0.8.0 2016-06-17
0.7.1 2015-07-26
0.7.0 2015-01-10
0.6.8 2015-01-09
0.6.5 2015-01-09
0.6.4 2015-01-09
0.6.2 2014-12-06
0.6.1 2014-08-05
0.6.0 2014-08-01
0.5.1 2014-06-14
0.5.0 2014-06-14
0.4.5 2014-06-13
0.4.4 2014-06-13
0.4.3 2014-06-13
0.4.2 2014-06-11
0.4.1 2014-06-11
0.4.0 2014-06-11
0.3.0 2014-06-11
0.2.5 2014-06-11
0.2.4 2014-06-11
0.2.3 2014-06-11
0.2.2 2014-06-11
0.2.1 2014-06-11
0.2.0 2014-06-11
0.1.0 2014-06-11