unplugin / unplugin/unplugin-auto-import
Lazy-loaded routing pages do not generate declarations in `auto-imports.d.ts`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.8k
- Forks
- 217
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked StackBlitz reproduction and inspect src/typings/auto-imports.d.ts before and after a build. Trace when declarations are generated for the lazy-loaded routing page; done means the declaration remains complete even when that page has not been loaded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100