a group and aggregate plugin for gulp
Usage
First, install gulp-group-aggregate
as a development dependency:
npm install --save-dev gulp-group-aggregate
Then, add it to your gulpfile.js
:
var path = ;var groupAggregate = ; var {...}; gulp;
API
gulp-group-aggregate is a function(options)
that returns a read-write stream
. The options argument should include two functions: group and aggregate.
options.group
Type: function(File)
returns string
Receives a vinyl from the stream and returns a string which represents its group.
options.aggregate
Type: function(string, File[])
returns File.options
Receives a group string as returned from group calls and an array of all the files associated with it. Returns a vinyl constructor.options object. The options will be used to construct a file which will be pushed through the stream.