zont/gulp-usemin — pull request #70 by Frizi (2014-10-27 14:22:19+00:00)
Title: Stream based, async task tolerant block processor

Hi,

I've made quite a big changes to this project to fix quite a lot bugs I had to deal with in private project. Usemin basicly creates a set of streams, routes it together and passes to the output. All of it is handled with help of promises.

Unfortunately, I had to make a breaking change in pipeline usage, as the plugins cannot be assumed to work when initialized prior to piping. The previous approach created a lot of random, unexpected missing files in my setup. This change also fixes random 'silent crashes' when dealing with asynchronous tasks.

Documentation and tests included.

Breaking changes:
You cannot define pipelines as arrays, constructor function needs to be made instead.
It accepts stream and prepared concat task as input and expects piped stream as output.
Default pipeline is simply stream.pipe(concat);

```
return gulp.src('./*.html')
.pipe(usemin({
css: function (stream, concat) {
return stream
.pipe(minifyCss())
.pipe(concat);
}));
```

New features:
Assets can be streamed in instead of read from filesystem. See 'assetsStream' option and related documentation in readme. This enables the on the fly compilation of sass/coffee/others without the need to save it to filesystem.