Skip to content
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

Watcher ignores glob pattern when adding subdirectories #69

Closed
thorsent opened this issue Aug 30, 2022 · 3 comments
Closed

Watcher ignores glob pattern when adding subdirectories #69

thorsent opened this issue Aug 30, 2022 · 3 comments

Comments

@thorsent
Copy link

The watcher walks subdirectories based on the initial directory that is provided in the glob pattern. This can cause serious performance issues.

Take for instance the glob pattern /myproject/package.json . In order to watch this single file, cpx2's watcher will first wall all subdirectories of /myproject. Things can bog down in a hurry if your project contains node_modules.

I'm not sure if there's an easy fix. Possibly a better approach that using minimatch would be to use glob itself to return the list of directories and files.

Let me know if you have any possible workarounds.

@thorsent
Copy link
Author

glob-watcher looks like it could do most of the work.

@bcomnes
Copy link
Owner

bcomnes commented Nov 28, 2022

Sorry I totally missed this. I added glob-gitignore a while ago that can efficiently add gitignore style rules along side the glob. That might help out a bit.

@thorsent
Copy link
Author

Thanks, yes I've used the gitignore for some cases. I've worked around my performance issues manually. Maybe one day I'll find some free time to contribute some performance improvements. I'll close the issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants