unplugin / unplugin-vue-components

📲 On-demand components auto importing for Vue
https://www.npmjs.com/package/unplugin-vue-components
MIT License
3.83k stars 352 forks source link

components.d.ts does not update when component file added/deleted #652

Open zhuscat opened 1 year ago

zhuscat commented 1 year ago

Describe the bug

components.d.ts does not update when file added/deleted in src/components(using vue cli, pnpm serve is running).

I'm also using Nuxt, I noticed that in Nuxt when file created/deleted in components directory, components.d.ts will update. So I'm wondering if this is a BUG.

Reproduction

https://github.com/zhuscat/test-unplugin-vue-components

System Info

System:
    OS: macOS 13.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 2.91 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.15.0/bin/yarn
    npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm
    pnpm: 8.6.1 - ~/.nvm/versions/node/v16.15.0/bin/pnpm
  Browsers:
    Chrome: 114.0.5735.198
    Safari: 16.4

Used Package Manager

pnpm

Validations

lanpangzhi commented 1 year ago

vite 里也有这个问题

lishaobos commented 1 year ago

In my test, the new addition will be added automatically, delete it is not, delete this can be optimized

memen45 commented 1 year ago

Same issue here. Imports are added, but not removed. Is there a way to manually remove imports from / update the components file?

l1548844035 commented 1 year ago

而且在vite里面你重命名组件也只是新增了重命名组件后的文件,不是直接修改旧的或者将旧的删除,还是有什么参数没加吗

tassin-gauthier commented 1 year ago

I agree, addition of component update the components.d.ts file, but deletion of component doesn't.

The current solution is to let the wrong components into the components.d.ts file, remove manually the components from the file, or delete the components.d.ts and recreate it. Not really ergonomic, and I think it could be easy to detect this change.

digisomni commented 1 year ago

Yeah this is also an issue for me, should auto delete the old stuff.

Kasopej commented 12 months ago

any update on this issue? I currently have to restart my dev server every time I add a new component, really painful! Thanks in advance!

narduin commented 5 days ago

Hello, this is still an issue today. Only workaround is either to build the project or to manually delete the file, which is not ideal.