Tag: gulp through2

获取through2stream的JSON /string?

我有一堆zip文件,每个文件都包含一个.config文件。 我想迭代每个zip文件,解压缩它,读取configuration文件,然后使用该configuration文件将zipfile upload到某处。 gulp.task('deploy-zips', function () { const filter = config()[target].filter; return gulp.src([destination + '/' + filter]) .pipe(deployZips()); }); 这是任务的切入点。 function deployZips() { return through({ objectMode: true }, function (zipFile, zipEncoding, zipCallback) { gutil.log(zipFile.path.split('\\').reverse()[0]); gulp.src(zipFile.path) .pipe(unzip({ filter : function(entry){ if (entry.type !== 'File') { return false; } return entry.path.indexOf('deploy-config.json') > -1; } })) .pipe(through({ objectMode: […]