You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using !(node_modules)/**/package.json still seems to search within node_modules...or at least its still very slow compared to every other library I'm testing.
I addresed a similar use case in QUnit sometime ago using picomatch incombination with a recursive fs.readdir call (for gathering files), and node-watch for performant watching over an entire project (and exclude node_modules):
I switched the "gather files" part from picomatch to tiny-glob in the above change, because I found it to make the code simpler (and probably faster too). If you need to gather all files but not enter node_modules, I would restructured the call so as to invoke glob separately for the top-level directories and skip node_modules at that level, and use glob only for recursing within each of the top-level directories.
Activity
Krinkle commentedon Oct 22, 2021
I addresed a similar use case in QUnit sometime ago using
picomatchincombination with a recursivefs.readdircall (for gathering files), andnode-watchfor performant watching over an entire project (and exclude node_modules):qunitjs/qunit@b7fb112
I switched the "gather files" part from picomatch to
tiny-globin the above change, because I found it to make the code simpler (and probably faster too). If you need to gather all files but not enter node_modules, I would restructured the call so as to invoke glob separately for the top-level directories and skipnode_modulesat that level, and use glob only for recursing within each of the top-level directories.vjpr commentedon Oct 22, 2021
In a monorepo this won't work - there will be 100s of nested
node_modules.tiny-globneeds to have a way to not enter dirs.IanVS commentedon Sep 29, 2022
Agree, without this feature, I can't adopt tiny-glob, which I was planning to do for storybook.
chdh commentedon Dec 28, 2022
It's probably easier to add an
excludeoption to prevent traversing of unwanted directories.see #74
see How to exclude directory from reading? for fast-glob
techsin commentedon May 2, 2024
any update?