-
-
Notifications
You must be signed in to change notification settings - Fork 22
Closed as not planned
Closed as not planned
Copy link
Labels
enhancementNew feature or requestNew feature or request
Description
In Vite, when a file is updated, we check whether that file is included in the glob to know whether the file containing a glob has to be updated.
Links to relevant code
https://github.com/vitejs/vite/blob/802839d48335a69eb15f71f2cd816d0b6e4d3556/packages/vite/src/node/plugins/importMetaGlob.ts#L66-L81
https://github.com/vitejs/vite/blob/802839d48335a69eb15f71f2cd816d0b6e4d3556/packages/vite/src/node/plugins/importMetaGlob.ts#L89-L106
I guess Vite cannot simply use picomatch as tinyglobby has more features. It would be nice if tinyglobby exposes a function that returns whether a file path matches the glob.
import { globMatcher } from 'tinyglobby';
const match = globMatcher(['files/*.ts', '!**/*.d.ts'], { cwd: 'src' }); // pass in the same options
const result = match('files/bar.ts') // pass the file path
expect(result).toBe(true)marvinhagemeister
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request