【问题标题】:Run one gulp4 task on multiple folders在多个文件夹上运行一个 gulp4 任务
【发布时间】:2020-12-15 11:02:30
【问题描述】:

我尝试将 gulp 任务运行到多个文件夹 但我有一个问题

实际上,我运行一个函数(任务)并没有问题

const componentsPaths = glob.sync(comSrcPath + '/*/');
function conactComJs(path) { 
    // concat all js components 
    return src([path + '**/01_*.js', path + '**/02_*.js', path + '**/03_*.js', path + '**/*.js'])
        .pipe(concat('init.js'))
        .pipe(dest(path + 'js'));
}

 function conactAllComJs() {
        let stream;
        // // work on each folder separately
        componentsPaths.forEach(function (path) {
            stream = conactComJs(path);
        });
        return stream;
  }; 
exports.components = series(conactAllComJs());

【问题讨论】:

    标签: javascript node.js gulp glob


    【解决方案1】:

    我发现 我以错误的方式调用任务

    exports.components = series(conactAllComJs);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-21
      • 1970-01-01
      • 1970-01-01
      • 2020-07-23
      • 1970-01-01
      • 2015-07-28
      相关资源
      最近更新 更多