Comments (17)
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.
@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.
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.
@phated Yeah it will probably support both. I want an alternate for people who don't want to learn globs past * and **.
from gulp.
/cc @robrich
from gulp.
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.
@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.
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.
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.
FINALLY finished in 3.0
from gulp.
.src()
still doesn't accept an glob of paths to ignore, correct?
from gulp.
@Jakobud it does, please read the docs. You can pass multiple positive or negative globs
from gulp.
Where in the docs? https://github.com/gulpjs/gulp/blob/master/docs/API.md Am I missing something?
from gulp.
@Jakobud Please reference https://github.com/wearefractal/vinyl-fs#srcglobs-opt
from gulp.
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.
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.
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)
- Gulp 5 corrupt images HOT 3
- v5 : Series tasks fail where running individually pass HOT 4
- Gulp 5 - Copied images using .src and .dest are corrupt HOT 3
- In gulp 4.0.2 fonts are displayed correctly, and in version 5.0.0 there are constant errors HOT 3
- Gulp v5.0.0 png and jpg images not opening after transferring via gulp HOT 2
- v5: after updating gulp to version 5, jpg and png files are not readable after src-dest processing HOT 7
- Option no-sort doesn't seem to work on gulp 5.0.0 HOT 5
- Gulp v5.0.0 does not work if the root folder contains too many files (Works in Gulp v4.0.2) HOT 1
- Static files broken HOT 2
- Simple gulp copy garbles font files HOT 10
- PNG files are corrupted after Gulp upgrade to 5.0 HOT 7
- v5: Stuck in infinite loop in some cases HOT 3
- Gulp.src/gulp.dest does not copy images or fonts correctly in [email protected] HOT 3
- Gulp v5 corrupt font files HOT 5
- not support node22 HOT 1
- gulp imagemin task is not working properly for the v5.0.0 gulp HOT 2
- Test fail on the latest version HOT 3
- `Unhandled 'error' event` error in gulp 5 HOT 3
- Corruption of image files during migration or optimization HOT 25
- (node:7504) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp.