Gulp排除无法正常工作 [英] Gulp exclude does not work as expected

查看:96
本文介绍了Gulp排除无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个类似这样的任务,只是src部分:

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:

  • 首先加载global.scss(有效)
  • 加载其余的scss文件(有效)
  • 排除所有域(有效)
  • 将我的一个域包括回(不起作用)
  • Load global.scss first (works)
  • Load the rest of the scss files (works)
  • Exclude all but domain (works)
  • Include one of my domains back (does not work)

因此由于某种原因,我无法将域添加回列表中.有什么想法吗?

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

推荐答案

这似乎是预期的行为,因为所有否定小球都运行 last !请参见 gulp.src否定顺序问题.

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 ..使用gulp4.0-应该在那里固定.

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

2 .. gulp-add-src 添加最后一个文件回来.

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

3 .. merge2 创建两个单独的流,然后将其合并.

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

这篇关于Gulp排除无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆