koa-files-combiner
A koa middleware for combining files.
Usage
var koa = var combine = var app = app app
Then request the files bundle in browser:
http://localhost:3000/combine/js/global/libs.min.js,/bootstrap/bootstrap.min.js
/-------/--/------------------,/--------------------------
| | file1 file2
| |
| type("js" or "css", for MIME)
|
use combine service
Options
app
which options
could be:
{
prePathParser: function(url) { /*...*/ return url },
pathParser: function(url) { /*...*/ return filesObj },
postPathParser: function(filesObj) { /*...*/ return filesObj }
}
the filesObj
should be:
{
type: 'js',
files: ['path/to/file1.js', 'path/to/file2.js']
}