unplugin-auto-import icon indicating copy to clipboard operation
unplugin-auto-import copied to clipboard

auto-imports.d.ts contents will be deleted unexpectedly

Open ishowman opened this issue 1 year ago • 3 comments

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.

ishowman avatar Feb 26 '23 23:02 ishowman

just use options.cache

lishaobos avatar Feb 28 '23 06:02 lishaobos

请问最新版本是否解决了你的问题

lishaobos avatar May 31 '23 02:05 lishaobos

@lishaobos 大佬我玩不太明白,有些疑问需要你解答下哈。 请问 auto-imports.d.ts 是不是只有在 vite 触发 new dependencies optimized 更新时,才会自动更新呢?另外一个 plugin unplugin-vue-components 是否也是同样的机制? image

目前测试了新版本,只会增量更新。

  • 删除引用组件, auto-imports.d.ts 不会自动删除组件信息;
  • 只有在添加组件后,并触发 vite 的 new dependencies optimized ,才会自动添加组件信息(如页面新增了组件,但未访问页面,不会触发 vite 的 new dependencies optimizedauto-imports.d.ts 文件也就不会更新)

ishowman avatar Mar 04 '24 10:03 ishowman