unplugin-auto-import
unplugin-auto-import copied to clipboard
Lazy-loaded routing pages do not generate declarations in `auto-imports.d.ts`
The type declaration is generated in auto-imports.d.ts
only when it needs to be loaded into a lazy-loaded routing page.
The auto-imports.d.ts
file is reset every time the project is built; if the lazy loading page is not loaded, the auto-imports declaration will not be generated, and the project file will indicate that the module cannot be found at this time
reproduction project: https://stackblitz.com/github/Mrlilili/auto-import-test?file=src/typings/auto-imports.d.ts
https://user-images.githubusercontent.com/8361655/179142755-ee045cac-d146-434f-a6fe-adf5cde92982.mov
Have the same problem
My scenario is some pages with manual import API and some pages without manual import Vue-tsc --noEmit failed directly when I built because auto-imports. D. ts doesn't have this API
Because performance considerations are the result? I really wish the auto-imports. D. ts generation rule would provide a configuration item for the user to decide if it is full
At the moment I have to agree on my own rules of use: either no manual import at all or manual import of all pages
I look forward to your solution
I also have the same problem. The scenario is that after packaging, only the routing components loaded lazily by the route cannot jump, prompting that the module cannot be found. My only way is to introduce all the routing components into the routing table
yes, some problem router click and add, but reload vite and delete :D
同样的问题,希望提供一个可以检查全局文件的命令操作,可以无缺漏的生成.d.ts文件
same problem, i decide to to manual manage *.d.ts, not use auto generate file
same problem, i decide to to manual manage *.d.ts, not use auto generate file
项目庞大,并且是多人协作开发的时候,我无法知晓哪些已经使用过的,维护起来苦不堪言,还是需要自动生成的。