}) cb() })
vfs.src(path.join(modulePath, 'dist', '_', '**', 'images', '**')) .pipe(through2.obj(function(file, enc, cb){ if (!file.isDirectory()) { var fp = file.path; var fb = file.base; var fbaseAfter = fp.replace(fb, ''); var fbaseDist = fb.replace(path.join(modulePath, 'dist'), ''); if (fbaseDist.indexOf('images') <= 0 && fbaseAfter.indexOf('images') >= 0) { fbaseAfter = fbaseAfter.substr(0, fbaseAfter.indexOf('images') + 7); file.base = path.join(file.base, fbaseAfter); } this.push(file); } cb(); })) .pipe(vfs.dest(path.join(modulePath, 'dist', '_static', 'images'))) .on('end', function () { resolve(); });
.pipe(through2.obj(function (file, enc, cb) { if (file.isNull() || file.isStream()) { return cb(null, file); cb(); }, function (cb) { if (fileContents.length > 0) { this.push(file); cb(); })) .pipe($.postcss([sprites(opts)])) .pipe(through2.obj(function (file, enc, cb) { if (file.isNull() || file.isStream()) { return cb(null, file); this.push(file); }.bind(this)); cb(); })) .pipe(vfs.dest(path.join(modulePath, 'dist', '_static')))
.pipe(through2.obj(function (file, enc, cb) { if (file.isNull() || file.isStream()) { return cb(null, file); cb(); }, function (cb) { if (fileContents.length > 0) { this.push(file); cb(); })) .pipe($.postcss([sprites(opts)])) .pipe(through2.obj(function (file, enc, cb) { if (file.isNull() || file.isStream()) { return cb(null, file); this.push(file); }.bind(this)); cb(); })) .pipe(vfs.dest(path.join(modulePath, 'dist', '_static', 'css')))