我有不同环境的列表 我试图在单个任务中为每个环境构建。
例如:
Blockquote
gulp.task('ci', ciBuilder);
function ciBuilder(){
var envs = Object.keys(global.envs);
for (var iEnv = 0; iEnv < envs.length; iPublisher++) {
global.env = env[iEnv];
gutil.log('starting build for ' + global.env + '...');
runSequence('include-files', 'replace-js', 'uglify-js');
}
}
runSequence中的3个任务中的每个任务都以“ return”结束。 而不是获得3个完整版本,我得到的是:
Blockquote
[17:50:17] starting build for qa1...
[17:50:17] starting build for qa2...
[17:50:17] starting build for qa3...
[17:50:17] Finished 'ci' after 15 ms
(node:87734) Warning: Possible EventEmitter memory leak detected. 11 task_stop listeners added. Use emitter.setMaxListeners() to increase limit
(node:87734) Warning: Possible EventEmitter memory leak detected. 11 task_err listeners added. Use emitter.setMaxListeners() to increase limit
[17:50:17] Finished 'include-files' after 78 ms
[17:50:17] Starting 'replace-js'...
[17:50:17] Finished 'replace-js' after 22 ms
[17:50:17] Starting 'replace-js'...
[17:50:17] Finished 'replace-js' after 6.21 ms
[17:50:17] Starting 'uglify-js'...
[17:50:17] Finished 'uglify-js' after 4.2 ms
无需多说,如果我在循环内没有特定环境的情况下运行序列,则可以正常工作 我想念什么?