Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

Sugar for tech filter #11

Open
tadatuta opened this issue Sep 7, 2016 · 2 comments
Open

Sugar for tech filter #11

tadatuta opened this issue Sep 7, 2016 · 2 comments

Comments

@tadatuta
Copy link
Member

tadatuta commented Sep 7, 2016

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

@belozer
Copy link

belozer commented Nov 24, 2016

@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
Copy link
Member

qfox commented Dec 7, 2017

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants