gulp-bem / gulp-bem-bundle-builder

DEPRECATED repository, moved to https://github.com/bem/gulp-bem/tree/master/packages/gulp-bem-bundle-builder
Other
3 stars 1 forks source link

Sugar for tech filter #11

Open tadatuta opened 8 years ago

tadatuta commented 8 years ago

Sugar for .pipe(require('through2-filter').obj(file => file.tech !== 'bemhtml.js')) needed.

belozer commented 7 years ago

@tadatuta And what's wrong with this?

const filter = require('through2-filter').obj;
...
.pipe(filter(file => file.tech !== 'bemhtml.js'))

or do you want

.pipe(withoutTech('bemhtml.js'))

?

qfox commented 6 years ago

Yeah, feels like we need something like

bundle.src('js', {filter: {tech: ['vanilla.js', 'browser.js', 'js']}})
// or
bundle.src('js', {filter: ({tech}) => ['vanilla.js', 'browser.js', 'js'].includes(tech) })
// instead of
bundle.src('js').pipe(filter(f => ['vanilla.js', 'browser.js', 'js'].indexOf(f.tech) !== -1))

It's a very common case in the new world