-
gulp-reduce-to-file: 将多个文件流合并为一个单文件
资源介绍
gulp-reduce 到文件
减少插件
用法
首先,安装gulp-reduce-to-file作为开发依赖:
npm install --save-dev gulp-reduce-to-file
然后,将其添加到您的gulpfile.js :
var reduce = require ( "gulp-reduce-to-file" ) ;
function accumulate ( accum , file ) {
var contents = file . contents . toString ( 'utf8' ) ;
accum [ file . path ] = contents . length ;
return accum ;
} ;
gulp . src ( "./src/*.ext" )
. pipe ( reduce ( accumu