perf: make fast-glob always ignore node_modules while allowing patterns to include node_modules#7436
perf: make fast-glob always ignore node_modules while allowing patterns to include node_modules#7436brillout wants to merge 3 commits intovitejs:mainfrom
node_modules while allowing patterns to include node_modules#7436Conversation
…erns to include `node_modules`
|
Interesting optimization. Did you perform some profiling? It would be great to have some numbers for real apps. One issue is that this is potentially a breaking change in case a pattern will look into Added to discuss with the team. |
|
The number of files in For example, the demo vps framework https://github.com/brillout/vite-plugin-ssr/tree/0.4.0/examples/framework. The This means
Yes, this PR makes
As always, I can join the discussion as a guest, if there is interest. (I think, in general, inviting guests that the Vite team trusts to join team meetings for specific PRs could make sense.) |
|
We talked about the PR today @brillout. Since we now have added import.meta.glob('node_modules/framework/**/*.page.js', {
ignore: 'node_modules/framework/**/node_modules/**'
})We didn't discuss this, but given that we support fast glob arrays in options like import.meta.glob([
'node_modules/framework/**/*.page.js',
'!node_modules/framework/**/node_modules'
])I don't know if we should support both, so we probably need to keep iterating. But I think we will end up with one of these two options. |
|
Makes sense, I like it, and PR is done: #7482. Closing this in favor of the new PR. |
Description
This is a performance improvement on top of @frandiox's PR #6056.
Additional context
Hydrogen and vps frameworks (will) use
import.meta.globfor crawling insidenode_modules/, e.g.import.meta.glob('node_modules/some-framework/**/*.page.js'). This PR increases the performance by, potentially, several orders of magnitude.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).