unplugin / unplugin/unplugin-auto-import

Lazy-loaded routing pages do not generate declarations in `auto-imports.d.ts`

Open
#233 7 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.