Jens Törnell
Jens Törnell

Reputation: 24768

Gulp exclude does not work as expected

I have a gulp task that looks like this, just the src part:

gulp.src(
    [
    'site/bricks/global/global.scss',
    'site/bricks/**/*.scss',
    '!site/bricks/global/domain*.scss',
    'site/bricks/global/domain.mydomain.com.scss'
    ])

I expect it to do this:

So for some reason I can't add a domain back to the list. Any ideas?

Upvotes: 1

Views: 39

Answers (1)

Mark
Mark

Reputation: 181218

It looks like that is expected behavior because all negation globs run last! See gulp.src negation order issues.

You have a few options though:

1.. Use gulp4.0 - supposed to be fixed there.

2.. gulp-add-src add that last file back in.

3.. merge2 create two separate streams and then merge them.

Upvotes: 2

Related Questions