[bug]: can not work with vite8
### Describe the bug
```text
"unplugin-auto-import": "21.0.0",
"vite": "8.0.0-beta.12",
```
```ts
// vite.config.ts
import { defineConfig } from 'vite';
import autoImport from 'unplugin-auto-import/vite';
export default defineConfig({
plugins: [
autoImport({
imports: [
{
vue: ['h', 'Teleport', 'ref'],
},
],
}),
],
});
```
```ts
// main.ts
export const x = () => {
const h = 1;
const Teleport = 1;
};
console.log({
h: typeof h,
Teleport: typeof Teleport,
ref: typeof ref,
});
```
output
```text
{
"h": "undefined",
"Teleport": "undefined",
"ref": "function"
}
```
### Reproduction
https://stackblitz.com/edit/vitejs-vite-p8rv3ns4?file=package.json,src%2Fmain.ts&terminal=dev
### System Info
```Shell
System:
OS: Windows 11 10.0.26200
CPU: (32) x64 Intel(R) Core(TM) i9-14900HX
Memory: 10.67 GB / 31.71 GB
Binaries:
Node: 24.8.0 - C:\Users\lisonge\scoop\apps\volta\current\appdata\tools\image\node\24.8.0\node.EXE
npm: 11.6.0 - C:\Users\lisonge\scoop\apps\volta\current\appdata\tools\image\node\24.8.0\npm.CMD
pnpm: 10.23.0 - C:\Users\lisonge\scoop\apps\volta\current\appdata\tools\image\pnpm\10.23.0\bin\pnpm.CMD
Deno: 2.6.6 - C:\Users\lisonge\scoop\shims\deno.EXE
Browsers:
Edge: Chromium (143.0.3650.75)
Internet Explorer: 11.0.26100.7309
```
### Used Package Manager
pnpm
### Validations
- [x] Follow our [Code of Conduct](https://github.com/antfu/.github/blob/main/CODE_OF_CONDUCT.md)
- [x] Read the [Contributing Guide](https://github.com/antfu/contribute).
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [x] The provided reproduction is a [minimal reproducible](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
1 条评论