Bjorn Lu
Bjorn Lu
cc @antfu requesting your review since you authored glob imports before, and have a recent `as: 'path'` PR.
The main issue for me is that I don't think import assertions/attributes is going to solve queries. They're not exactly the same thing, and queries tend to be more flexible,...
I'll move this off 5.0 for now. It actually seems that this can be done non-breakingly but the deprecation would have to come in a minor if we do so.
Note to self: There's a bit more perf improvements I found especially: 1. We don't need to call `parseRequest`, we can inline it and avoid its `Object.entries` call. 2. We...
`this.load()` would be the right way to handle it, but currently it's freezing on https://github.com/vitejs/vite/blob/a2e9fb5243874686603814f41410c5b9ba6ac54a/packages/vite/src/node/plugins/optimizedDeps.ts#L48 Our current flow is that we're resolving optimized depedencies eagerly, so you're getting a path...
Making this work will be tricky but not impossible. When you do ```import(`dayjs/locale/${'en'}`)```, what happens is that Vite needs to glob `dayjs/locale/*` to identify the possible values of `*` and...
You need strings inside `import()` to be static like the first example. Most bundlers require that so it's statically analyzable for bundling. I think it's not quite related to this...
We're not intentionally not supporting it, it's that this usecase wasn't considered in the initial design/support for glob imports. It started out as a way to glob relative files so...
The main starting point would be the [`importMetaGlob` Vite plugin](https://github.com/vitejs/vite/blob/40fd2d9bf4073420e6c334f48dc3b63558b688ce/packages/vite/src/node/plugins/importMetaGlob.ts). This line in particular is what Vite has today to resolve glob paths: https://github.com/vitejs/vite/blob/a43167ca3f0feeac9e58c0bc809b4d1acf0e1ec6/packages/vite/src/node/plugins/importMetaGlob.ts#L544-L548 (search for `resolveId` in that file...
Sorry for the late reply. I've been focusing on getting Vite 5 out and missed this. `resolvedFileName` being `undefined` is expected I believe because IIUC you're trying to resolve `some-pkg/**/*.js`...