gulp copy任务完成延迟

时间:2015-07-16 02:25:56

标签: npm gulp

我有一些简单的问题......在我说完成之前,我希望完成一项任务......

以下是我正在执行的代码段

            gulp.task('copyFiles',  function(cb) {
            gulp.src(['./bower_components/bootstrap/fonts/**',
                './bower_components/font-awesome/fonts/**'])
                .pipe(gulp.dest('./dist/fonts'))
                .on('finish', function() {
                    console.log('finished copying fonts');
                });
                cb();
                });

我期待的输出是

started copyFiles..
finished copying fonts ==> It actually completes the copy
finished copyFiles after .. ms

我得到的是

Started copyFiles..
finished copyFiles after .. ms
finished copying fonts ==> this message appears after the task completed.

我正在尝试处理的核心问题是我在复制步骤完成后执行了一些CSS捆绑步骤。虽然我使用了run-sequence或async.series()之类的实用程序..但它没有帮助,因为任务在它真正完成之前就已经退出了。

关于为什么会发生这种情况的任何想法?

谢谢!

0 个答案:

没有答案
相关问题