unplugin-auto-import
unplugin-auto-import copied to clipboard
auto-imports.d.ts contents will be deleted unexpectedly
Describe the bug
Read it for more detail: https://github.com/element-plus/element-plus/issues/11726
Reproduction
https://github.com/ishowman/vue3-ts-template-list/tree/element-plus
System Info
Vue Version: 3.2.45
Element Plus Version: 2.2.32
Browser / OS: Chrome 102.0.5005.115
Build Tool: Vite
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.
just use options.cache
请问最新版本是否解决了你的问题
@lishaobos 大佬我玩不太明白,有些疑问需要你解答下哈。
请问 auto-imports.d.ts
是不是只有在 vite 触发 new dependencies optimized
更新时,才会自动更新呢?另外一个 plugin unplugin-vue-components
是否也是同样的机制?
目前测试了新版本,只会增量更新。
- 删除引用组件,
auto-imports.d.ts
不会自动删除组件信息; - 只有在添加组件后,并触发 vite 的
new dependencies optimized
,才会自动添加组件信息(如页面新增了组件,但未访问页面,不会触发 vite 的new dependencies optimized
,auto-imports.d.ts
文件也就不会更新)