-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow excluding specific file patterns in nested directories #31
Comments
This is a limitation of globs. I think it should work if you do this, though: {
"files": [
"/dist/",
"!/dist/**/*.test.js"
]
} The second rule will override the first, and re-ignore those files. |
That works for my use case. Thanks! Could you please clarify why the pattern I'm referring to this block in particular - it takes the pattern Lines 186 to 188 in 270f534
|
Because at that point it does not know if it's a directory or a file. This behavior is overly aggressive in what it includes, though, and leads to problems. For example, That'll be fixed in v2. |
For a file pattern such as
dist/**/!(*.test.js)
, the package currently adds an entry of!dist/**/!(*.test.js)/**
for the ignore-walker, which results in paths such asdist/lib/x.test.js
getting included in the pack. I raised the PR #29 as a possible solution, but I've since closed it because I felt it wasn't the right approach.The following unit test file can be added to assert this behaviour.
Thanks!
The text was updated successfully, but these errors were encountered: