through.obj(function(dir, e, c) {
var _build = function(_path, out, c) {
if ((out.existing && fs.readFileSync(out.path, 'utf-8').indexOf(builder._MODULE_GENERATOR) !== 0)
|| !checkReg(out.path.substr(dir.path.length + 1).replace(/[\\]/g, '/'), includes, excludes)) {
c();
return;
_excludes = _excludes.concat('^' + out.path.substr(dir.path.length + 1).replace(/[\\]/g, '/').replace('\.', '\\.') + '$')
_buildModule(dir.path, _path, _path, false, true, includes, _excludes,
function(modules) {
var _file = new gutil.File({
base: dir.path,
path: out.path,
contents: new Buffer(
builder._MODULE_GENERATOR + '\n' + ejs.render(tpl, {
modules: modules,
path: out.path.substr(dir.path.length).replace(/\\/g, '/').replace(/\/[^/]+$/, '')
}))
});
gutil.log('build module: ' + _file.path + '\n' + _file.contents);
this.push(_file);
}.bind(this));
}.bind(this);
_build(dir.path, _parseOutput(output, dir.path), c);
})