unplugin / unplugin-auto-import

Auto import APIs on-demand for Vite, Webpack and Rollup
MIT License
3.21k stars 195 forks source link

unplugin-auto-import generate two directories with autoimported types #432

Open mblandr opened 11 months ago

mblandr commented 11 months ago

Describe the bug

I have this setup repo When I starting VS Code after dependencies installed, it create directory with autoimported types right in the root of the project 1 but when i run the project i got another autoimported types in the directory src/types 2 And for some reason autoimport for createRouter from vue-router happened in the types/auto-import.d.ts, not in the src/type s/autoimport.d.ts, so I should import createRouter manually from 'vue-router'. My setup is intended auto imported types to be in src/types, not in types in the root of the project. Is it a bug or I have something wrong with my setup/ VS Code settings/extensions?

Reproduction

get the repo provided, open it in VS Code, install deps with pnpm i, then restart VS Code - you will see types dir in the root of the project, then run pnpm dev and you will see autoimported types in src/types folder too

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (20) x64 Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
    Memory: 46.30 GB / 63.93 GB
  Binaries:
    Node: 20.8.0 - ~\AppData\Local\pnpm\node.EXE
    npm: 10.1.0 - ~\AppData\Local\pnpm\npm.CMD
    pnpm: 8.9.2 - ~\AppData\Local\pnpm\pnpm.EXE

Used Package Manager

pnpm

Validations

lishaobos commented 10 months ago

its works for me, try delete root/types and restart your project