unplugin-vue-components
unplugin-vue-components copied to clipboard
components.d.ts does not update when component file added/deleted
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
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [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 of the bug.
vite 里也有这个问题
In my test, the new addition will be added automatically, delete it is not, delete this can be optimized
Same issue here. Imports are added, but not removed. Is there a way to manually remove imports from / update the components file?
而且在vite里面你重命名组件也只是新增了重命名组件后的文件,不是直接修改旧的或者将旧的删除,还是有什么参数没加吗
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.
Yeah this is also an issue for me, should auto delete the old stuff.
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!