LoginSignup
12
10

More than 5 years have passed since last update.

gulpfileに書かれているタスク一覧を取得する

Posted at

gulpコマンドを実行する際に--tasksオプションをつける。

$ gulp --tasks
$ gulp --tasks
[05:48:35] Using gulpfile /path/to/gulpfile.js
[05:48:35] Tasks for /path/to/gulpfile.js
[05:48:35] ├── clean
[05:48:35] ├── hexo-reload
[05:48:35] ├── hexo-server
[05:48:35] ├── hexo-generate
[05:48:35] ├── copy
[05:48:35] ├─┬ serve:dist
[05:48:35] │ ├── clean
[05:48:35] │ └── hexo-generate
[05:48:35] ├── publish
[05:48:35] ├── atom
[05:48:35] └─┬ default
[05:48:35]   ├── hexo-reload
[05:48:35]   └── atom

ツリーでタスクの内容が表示される。

タスク名だけほしい

タスク名だけを取得したい場合には--tasks-simpleオプションをつける。

$ gulp --tasks-simple
$ gulp --tasks-simple
clean
hexo-reload
hexo-server
hexo-generate
copy
serve:dist
publish
atom
default

--tasks-simpleはgulpと連携するような外部ツールを作るときに役にたちそう。

12
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
10