命令行参数的好处就是方便控制,引用 Stack Overflow 的一个回答:
The environment setting is available during all subtasks. So I can use this flag on the watch task too.
通过 require('gulp-util').env
获得参数:
1 |
var util = require('gulp-util'); |
就可以这么用:
1 |
gulp watch --theme literature |