Giter Club home page Giter Club logo

Comments (17)

phated avatar phated commented on May 30, 2024

If it is going to take an array or string as src, then I think ignore should be the negated glob like grunt:

gulp.files(["./css/vendor/*.css", "!./css/app/*.css"])

ref #6

from gulp.

yocontra avatar yocontra commented on May 30, 2024

@phated Ignore will be in an option as the second argument like '.src(glob, {ignore: glob})'. Your main glob and ignore glob should also support arrays. I'm open to grunt style but I might need some convincing because I never saw the point

from gulp.

phated avatar phated commented on May 30, 2024

If it is implemented with node-glob, the negate syntax should already work, as per https://github.com/isaacs/node-glob#comparisons-to-other-fnmatchglob-implementations

from gulp.

yocontra avatar yocontra commented on May 30, 2024

@phated Yeah it will probably support both. I want an alternate for people who don't want to learn globs past * and **.

from gulp.

yocontra avatar yocontra commented on May 30, 2024

/cc @robrich

from gulp.

robrich avatar robrich commented on May 30, 2024

I dug into minimatch and node-glob quite a bit yesterday. It supports "!./.js" but not "{./.js,!./node_modules/}" making it pretty much useless. Grunt wraps node-glob in processPatterns() which flattens the results, specifically checks for globs that start with ! and manually handles them differently. All else being equal, I'd like to fix node-glob and/or minimatch, but @contra suggested starting over as both libraries are not very well tested nor maintained. Perhaps one of the dozen node-glob wrappers / work-a-likes already does this?

from gulp.

yocontra avatar yocontra commented on May 30, 2024

@robrich - Really the glob module does three things

  • Generates a regex from a glob (or set of globs)
  • Recursively crawls the file system (there are modules for this)
  • Matches file names against the regex

Only the regex generation needs to be split out and we can use existing crawlers and fs watchers for the other step

from gulp.

hparra avatar hparra commented on May 30, 2024

Pinging here. ATM the globbing impl cripples the expected behavior of several plugins with regards to globbed ignores, smart renaming and directory structure replication (another issue?).

Perhaps replicating grunt's globbing interface is the best route, though I personally don't mind the ignore method. I actually think it's more expressive and probably makes the filtering impl easier.

from gulp.

yocontra avatar yocontra commented on May 30, 2024

FYI for anyone currently having problems with this you can pipe multiple .src() calls into eachother to hold you over. For negation you can use the gulp-ignore plugin. This fix is taking longer than expected due to some tricky edge cases.

from gulp.

yocontra avatar yocontra commented on May 30, 2024

FINALLY finished in 3.0

from gulp.

Jakobud avatar Jakobud commented on May 30, 2024

.src() still doesn't accept an glob of paths to ignore, correct?

from gulp.

yocontra avatar yocontra commented on May 30, 2024

@Jakobud it does, please read the docs. You can pass multiple positive or negative globs

from gulp.

Jakobud avatar Jakobud commented on May 30, 2024

Where in the docs? https://github.com/gulpjs/gulp/blob/master/docs/API.md Am I missing something?

from gulp.

appleboy avatar appleboy commented on May 30, 2024

@Jakobud Please reference https://github.com/wearefractal/vinyl-fs#srcglobs-opt

from gulp.

Jakobud avatar Jakobud commented on May 30, 2024

Uh... okay I'm not sure what that has to do with gulp documentation or how I would have ever found that page.... but anyways, I still don't see anything on there about ignoring an array of paths when using .src().....

from gulp.

Jakobud avatar Jakobud commented on May 30, 2024

Okay I think I figured it out. I didn't see this anywhere in the gulp docs, but I could just do a array of globs like this:

[ 'myfile.js', '!ignoredFile.js' ]

from gulp.

yocontra avatar yocontra commented on May 30, 2024

I'll take a PR to make the docs better if you feel they are inadequate - they should probably include all of the info vinyl-fs docs do

from gulp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.